cmd2 4.1.1__tar.gz → 4.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. {cmd2-4.1.1 → cmd2-4.1.2}/CHANGELOG.md +6 -0
  2. {cmd2-4.1.1 → cmd2-4.1.2}/PKG-INFO +1 -1
  3. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/cmd2.py +4 -13
  4. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/utils.py +6 -3
  5. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2.egg-info/PKG-INFO +1 -1
  6. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2.egg-info/SOURCES.txt +0 -1
  7. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2.egg-info/scm_file_list.json +185 -185
  8. cmd2-4.1.2/cmd2.egg-info/scm_version.json +8 -0
  9. {cmd2-4.1.1 → cmd2-4.1.2}/examples/default_categories.py +6 -7
  10. {cmd2-4.1.1 → cmd2-4.1.2}/examples/getting_started.py +28 -25
  11. {cmd2-4.1.1 → cmd2-4.1.2}/examples/hello_cmd2.py +2 -2
  12. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_cmd2.py +26 -1
  13. cmd2-4.1.1/cmd2.egg-info/scm_version.json +0 -8
  14. cmd2-4.1.1/examples/cmd2_history.dat +0 -0
  15. {cmd2-4.1.1 → cmd2-4.1.2}/.pre-commit-config.yaml +0 -0
  16. {cmd2-4.1.1 → cmd2-4.1.2}/.prettierignore +0 -0
  17. {cmd2-4.1.1 → cmd2-4.1.2}/.prettierrc +0 -0
  18. {cmd2-4.1.1 → cmd2-4.1.2}/.typos.toml +0 -0
  19. {cmd2-4.1.1 → cmd2-4.1.2}/GEMINI.md +0 -0
  20. {cmd2-4.1.1 → cmd2-4.1.2}/LICENSE +0 -0
  21. {cmd2-4.1.1 → cmd2-4.1.2}/MANIFEST.in +0 -0
  22. {cmd2-4.1.1 → cmd2-4.1.2}/Makefile +0 -0
  23. {cmd2-4.1.1 → cmd2-4.1.2}/README.md +0 -0
  24. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/__init__.py +0 -0
  25. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/annotated.py +0 -0
  26. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/argparse_completer.py +0 -0
  27. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/argparse_utils.py +0 -0
  28. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/clipboard.py +0 -0
  29. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/colors.py +0 -0
  30. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/command_set.py +0 -0
  31. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/completion.py +0 -0
  32. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/constants.py +0 -0
  33. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/decorators.py +0 -0
  34. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/exceptions.py +0 -0
  35. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/history.py +0 -0
  36. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/parsing.py +0 -0
  37. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/plugin.py +0 -0
  38. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/pt_utils.py +0 -0
  39. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/py.typed +0 -0
  40. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/py_bridge.py +0 -0
  41. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/rich_utils.py +0 -0
  42. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/string_utils.py +0 -0
  43. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/styles.py +0 -0
  44. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/theme.py +0 -0
  45. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2/types.py +0 -0
  46. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2.egg-info/dependency_links.txt +0 -0
  47. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2.egg-info/requires.txt +0 -0
  48. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2.egg-info/top_level.txt +0 -0
  49. {cmd2-4.1.1 → cmd2-4.1.2}/cmd2.png +0 -0
  50. {cmd2-4.1.1 → cmd2-4.1.2}/codecov.yml +0 -0
  51. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/annotated.md +0 -0
  52. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/argparse_completer.md +0 -0
  53. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/argparse_utils.md +0 -0
  54. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/clipboard.md +0 -0
  55. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/cmd.md +0 -0
  56. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/colors.md +0 -0
  57. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/command_set.md +0 -0
  58. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/completion.md +0 -0
  59. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/constants.md +0 -0
  60. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/decorators.md +0 -0
  61. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/exceptions.md +0 -0
  62. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/history.md +0 -0
  63. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/index.md +0 -0
  64. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/parsing.md +0 -0
  65. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/plugin.md +0 -0
  66. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/pt_utils.md +0 -0
  67. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/py_bridge.md +0 -0
  68. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/rich_utils.md +0 -0
  69. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/string_utils.md +0 -0
  70. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/styles.md +0 -0
  71. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/theme.md +0 -0
  72. {cmd2-4.1.1 → cmd2-4.1.2}/docs/api/utils.md +0 -0
  73. {cmd2-4.1.1 → cmd2-4.1.2}/docs/doc_conventions.md +0 -0
  74. {cmd2-4.1.1 → cmd2-4.1.2}/docs/examples/alternate_event_loops.md +0 -0
  75. {cmd2-4.1.1 → cmd2-4.1.2}/docs/examples/examples.md +0 -0
  76. {cmd2-4.1.1 → cmd2-4.1.2}/docs/examples/getting_started.md +0 -0
  77. {cmd2-4.1.1 → cmd2-4.1.2}/docs/examples/index.md +0 -0
  78. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/annotated.md +0 -0
  79. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/argument_processing.md +0 -0
  80. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/async_commands.md +0 -0
  81. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/builtin_commands.md +0 -0
  82. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/clipboard.md +0 -0
  83. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/commands.md +0 -0
  84. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/completion.md +0 -0
  85. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/disable_commands.md +0 -0
  86. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/embedded_python_shells.md +0 -0
  87. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/generating_output.md +0 -0
  88. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/help.md +0 -0
  89. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/history.md +0 -0
  90. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/hooks.md +0 -0
  91. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/index.md +0 -0
  92. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/initialization.md +0 -0
  93. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/misc.md +0 -0
  94. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/modular_commands.md +0 -0
  95. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/multiline_commands.md +0 -0
  96. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/os.md +0 -0
  97. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/packaging.md +0 -0
  98. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/plugins.md +0 -0
  99. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/prompt.md +0 -0
  100. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/redirection.md +0 -0
  101. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/scripting.md +0 -0
  102. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/settings.md +0 -0
  103. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/shortcuts_aliases_macros.md +0 -0
  104. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/startup_commands.md +0 -0
  105. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/table_creation.md +0 -0
  106. {cmd2-4.1.1 → cmd2-4.1.2}/docs/features/theme.md +0 -0
  107. {cmd2-4.1.1 → cmd2-4.1.2}/docs/index.md +0 -0
  108. {cmd2-4.1.1 → cmd2-4.1.2}/docs/javascripts/readthedocs.js +0 -0
  109. {cmd2-4.1.1 → cmd2-4.1.2}/docs/migrating/incompatibilities.md +0 -0
  110. {cmd2-4.1.1 → cmd2-4.1.2}/docs/migrating/index.md +0 -0
  111. {cmd2-4.1.1 → cmd2-4.1.2}/docs/migrating/minimum.md +0 -0
  112. {cmd2-4.1.1 → cmd2-4.1.2}/docs/migrating/next_steps.md +0 -0
  113. {cmd2-4.1.1 → cmd2-4.1.2}/docs/migrating/why.md +0 -0
  114. {cmd2-4.1.1 → cmd2-4.1.2}/docs/mixins/index.md +0 -0
  115. {cmd2-4.1.1 → cmd2-4.1.2}/docs/mixins/mixin_template.md +0 -0
  116. {cmd2-4.1.1 → cmd2-4.1.2}/docs/overrides/main.html +0 -0
  117. {cmd2-4.1.1 → cmd2-4.1.2}/docs/overview/alternatives.md +0 -0
  118. {cmd2-4.1.1 → cmd2-4.1.2}/docs/overview/index.md +0 -0
  119. {cmd2-4.1.1 → cmd2-4.1.2}/docs/overview/installation.md +0 -0
  120. {cmd2-4.1.1 → cmd2-4.1.2}/docs/overview/integrating.md +0 -0
  121. {cmd2-4.1.1 → cmd2-4.1.2}/docs/overview/resources.md +0 -0
  122. {cmd2-4.1.1 → cmd2-4.1.2}/docs/stylesheets/cmd2.css +0 -0
  123. {cmd2-4.1.1 → cmd2-4.1.2}/docs/testing.md +0 -0
  124. {cmd2-4.1.1 → cmd2-4.1.2}/docs/upgrades.md +0 -0
  125. {cmd2-4.1.1 → cmd2-4.1.2}/examples/.cmd2rc +0 -0
  126. {cmd2-4.1.1 → cmd2-4.1.2}/examples/README.md +0 -0
  127. {cmd2-4.1.1 → cmd2-4.1.2}/examples/annotated_example.py +0 -0
  128. {cmd2-4.1.1 → cmd2-4.1.2}/examples/argparse_completion.py +0 -0
  129. {cmd2-4.1.1 → cmd2-4.1.2}/examples/argparse_example.py +0 -0
  130. {cmd2-4.1.1 → cmd2-4.1.2}/examples/async_call.py +0 -0
  131. {cmd2-4.1.1 → cmd2-4.1.2}/examples/async_commands.py +0 -0
  132. {cmd2-4.1.1 → cmd2-4.1.2}/examples/async_printing.py +0 -0
  133. {cmd2-4.1.1 → cmd2-4.1.2}/examples/basic_completion.py +0 -0
  134. {cmd2-4.1.1 → cmd2-4.1.2}/examples/cmd_as_argument.py +0 -0
  135. {cmd2-4.1.1 → cmd2-4.1.2}/examples/color.py +0 -0
  136. {cmd2-4.1.1 → cmd2-4.1.2}/examples/command_sets.py +0 -0
  137. {cmd2-4.1.1 → cmd2-4.1.2}/examples/completion_item_choices.py +0 -0
  138. {cmd2-4.1.1 → cmd2-4.1.2}/examples/custom_parser.py +0 -0
  139. {cmd2-4.1.1 → cmd2-4.1.2}/examples/custom_types.py +0 -0
  140. {cmd2-4.1.1 → cmd2-4.1.2}/examples/dynamic_commands.py +0 -0
  141. {cmd2-4.1.1 → cmd2-4.1.2}/examples/environment.py +0 -0
  142. {cmd2-4.1.1 → cmd2-4.1.2}/examples/event_loops.py +0 -0
  143. {cmd2-4.1.1 → cmd2-4.1.2}/examples/exit_code.py +0 -0
  144. {cmd2-4.1.1 → cmd2-4.1.2}/examples/help_categories.py +0 -0
  145. {cmd2-4.1.1 → cmd2-4.1.2}/examples/hooks.py +0 -0
  146. {cmd2-4.1.1 → cmd2-4.1.2}/examples/migrating.py +0 -0
  147. {cmd2-4.1.1 → cmd2-4.1.2}/examples/mixin.py +0 -0
  148. {cmd2-4.1.1 → cmd2-4.1.2}/examples/modular_commands/__init__.py +0 -0
  149. {cmd2-4.1.1 → cmd2-4.1.2}/examples/modular_commands/commandset_basic.py +0 -0
  150. {cmd2-4.1.1 → cmd2-4.1.2}/examples/modular_commands/commandset_complex.py +0 -0
  151. {cmd2-4.1.1 → cmd2-4.1.2}/examples/modular_commands/commandset_custominit.py +0 -0
  152. {cmd2-4.1.1 → cmd2-4.1.2}/examples/modular_commandsets.py +0 -0
  153. {cmd2-4.1.1 → cmd2-4.1.2}/examples/paged_output.py +0 -0
  154. {cmd2-4.1.1 → cmd2-4.1.2}/examples/persistent_history.py +0 -0
  155. {cmd2-4.1.1 → cmd2-4.1.2}/examples/pretty_print.py +0 -0
  156. {cmd2-4.1.1 → cmd2-4.1.2}/examples/python_scripting.py +0 -0
  157. {cmd2-4.1.1 → cmd2-4.1.2}/examples/read_input.py +0 -0
  158. {cmd2-4.1.1 → cmd2-4.1.2}/examples/remove_builtin_commands.py +0 -0
  159. {cmd2-4.1.1 → cmd2-4.1.2}/examples/remove_settable.py +0 -0
  160. {cmd2-4.1.1 → cmd2-4.1.2}/examples/rich_tables.py +0 -0
  161. {cmd2-4.1.1 → cmd2-4.1.2}/examples/rich_theme.py +0 -0
  162. {cmd2-4.1.1 → cmd2-4.1.2}/examples/scripts/arg_printer.py +0 -0
  163. {cmd2-4.1.1 → cmd2-4.1.2}/examples/scripts/conditional.py +0 -0
  164. {cmd2-4.1.1 → cmd2-4.1.2}/examples/scripts/nested.txt +0 -0
  165. {cmd2-4.1.1 → cmd2-4.1.2}/examples/scripts/quit.txt +0 -0
  166. {cmd2-4.1.1 → cmd2-4.1.2}/examples/scripts/save_help_text.py +0 -0
  167. {cmd2-4.1.1 → cmd2-4.1.2}/examples/scripts/script.py +0 -0
  168. {cmd2-4.1.1 → cmd2-4.1.2}/examples/scripts/script.txt +0 -0
  169. {cmd2-4.1.1 → cmd2-4.1.2}/examples/tmux_launch.sh +0 -0
  170. {cmd2-4.1.1 → cmd2-4.1.2}/examples/tmux_split.sh +0 -0
  171. {cmd2-4.1.1 → cmd2-4.1.2}/examples/unicode_commands.py +0 -0
  172. {cmd2-4.1.1 → cmd2-4.1.2}/mkdocs.yml +0 -0
  173. {cmd2-4.1.1 → cmd2-4.1.2}/package.json +0 -0
  174. {cmd2-4.1.1 → cmd2-4.1.2}/pyproject.toml +0 -0
  175. {cmd2-4.1.1 → cmd2-4.1.2}/ruff.toml +0 -0
  176. {cmd2-4.1.1 → cmd2-4.1.2}/scripts/validate_tag.py +0 -0
  177. {cmd2-4.1.1 → cmd2-4.1.2}/setup.cfg +0 -0
  178. {cmd2-4.1.1 → cmd2-4.1.2}/tests/.cmd2rc +0 -0
  179. {cmd2-4.1.1 → cmd2-4.1.2}/tests/__init__.py +0 -0
  180. {cmd2-4.1.1 → cmd2-4.1.2}/tests/conftest.py +0 -0
  181. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/echo.py +0 -0
  182. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/environment.py +0 -0
  183. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/help.py +0 -0
  184. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/py_locals.py +0 -0
  185. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/pyscript_dir.py +0 -0
  186. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/raises_exception.py +0 -0
  187. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/recursive.py +0 -0
  188. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/self_in_py.py +0 -0
  189. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/stop.py +0 -0
  190. {cmd2-4.1.1 → cmd2-4.1.2}/tests/pyscript/test_print.py +0 -0
  191. {cmd2-4.1.1 → cmd2-4.1.2}/tests/relative_multiple.txt +0 -0
  192. {cmd2-4.1.1 → cmd2-4.1.2}/tests/script.py +0 -0
  193. {cmd2-4.1.1 → cmd2-4.1.2}/tests/script.txt +0 -0
  194. {cmd2-4.1.1 → cmd2-4.1.2}/tests/scripts/binary.bin +0 -0
  195. {cmd2-4.1.1 → cmd2-4.1.2}/tests/scripts/empty.txt +0 -0
  196. {cmd2-4.1.1 → cmd2-4.1.2}/tests/scripts/help.txt +0 -0
  197. {cmd2-4.1.1 → cmd2-4.1.2}/tests/scripts/nested.txt +0 -0
  198. {cmd2-4.1.1 → cmd2-4.1.2}/tests/scripts/one_down.txt +0 -0
  199. {cmd2-4.1.1 → cmd2-4.1.2}/tests/scripts/postcmds.txt +0 -0
  200. {cmd2-4.1.1 → cmd2-4.1.2}/tests/scripts/precmds.txt +0 -0
  201. {cmd2-4.1.1 → cmd2-4.1.2}/tests/scripts/utf8.txt +0 -0
  202. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_annotated.py +0 -0
  203. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_argparse.py +0 -0
  204. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_argparse_completer.py +0 -0
  205. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_argparse_subcommands.py +0 -0
  206. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_argparse_utils.py +0 -0
  207. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_categories.py +0 -0
  208. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_commandset.py +0 -0
  209. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_completion.py +0 -0
  210. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_dynamic_complete_style.py +0 -0
  211. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_future_annotations.py +0 -0
  212. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_history.py +0 -0
  213. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_parsing.py +0 -0
  214. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_plugin.py +0 -0
  215. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_pt_utils.py +0 -0
  216. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_py_completion.py +0 -0
  217. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_rich_utils.py +0 -0
  218. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_run_pyscript.py +0 -0
  219. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_string_utils.py +0 -0
  220. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_theme.py +0 -0
  221. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_utils.py +0 -0
  222. {cmd2-4.1.1 → cmd2-4.1.2}/tests/test_utils_defining_class.py +0 -0
@@ -1,3 +1,9 @@
1
+ ## 4.1.2 (July 16, 2026)
2
+
3
+ - Enhancements
4
+ - Added possibility to use rich Text objects to set the description argument of a `Settable`
5
+ - Removed redundant `ipython` import which slowed application startup time
6
+
1
7
  ## 4.1.1 (July 9, 2026)
2
8
 
3
9
  - Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmd2
3
- Version: 4.1.1
3
+ Version: 4.1.2
4
4
  Summary: cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python
5
5
  Author: cmd2 Contributors
6
6
  License-Expression: MIT
@@ -177,9 +177,6 @@ from .types import (
177
177
  UnboundCompleter,
178
178
  )
179
179
 
180
- with contextlib.suppress(ImportError):
181
- from IPython import start_ipython
182
-
183
180
  try:
184
181
  if sys.platform == "win32":
185
182
  from prompt_toolkit.output.win32 import NoConsoleScreenBufferError # type: ignore[attr-defined]
@@ -1382,7 +1379,7 @@ class Cmd:
1382
1379
  Settable(
1383
1380
  "allow_style",
1384
1381
  allow_style_type,
1385
- ru.rich_text_to_string(settable_description),
1382
+ settable_description,
1386
1383
  self,
1387
1384
  choices_provider=get_allow_style_choices,
1388
1385
  )
@@ -1399,7 +1396,7 @@ class Cmd:
1399
1396
  Settable(
1400
1397
  "editor",
1401
1398
  str,
1402
- ru.rich_text_to_string(editor_description),
1399
+ editor_description,
1403
1400
  self,
1404
1401
  )
1405
1402
  )
@@ -1434,7 +1431,7 @@ class Cmd:
1434
1431
  Settable(
1435
1432
  "traceback_width",
1436
1433
  utils.optional_int,
1437
- ru.rich_text_to_string(traceback_width_description),
1434
+ traceback_width_description,
1438
1435
  self,
1439
1436
  )
1440
1437
  )
@@ -5151,13 +5148,7 @@ class Cmd:
5151
5148
  # Detect whether IPython is installed
5152
5149
  try:
5153
5150
  import traitlets.config.loader as traitlets_loader
5154
-
5155
- # Allow users to install ipython from a cmd2 prompt when needed and still have ipy command work
5156
- try:
5157
- _dummy = start_ipython # noqa: F823
5158
- except NameError:
5159
- from IPython import start_ipython
5160
-
5151
+ from IPython import start_ipython
5161
5152
  from IPython.terminal.interactiveshell import TerminalInteractiveShell
5162
5153
  from IPython.terminal.ipapp import TerminalIPythonApp
5163
5154
  except ImportError:
@@ -25,7 +25,10 @@ from typing import (
25
25
  cast,
26
26
  )
27
27
 
28
+ from rich.text import Text
29
+
28
30
  from . import constants
31
+ from . import rich_utils as ru
29
32
  from . import string_utils as su
30
33
  from .types import (
31
34
  CmdOrSet,
@@ -88,7 +91,7 @@ class Settable:
88
91
  self,
89
92
  name: str,
90
93
  val_type: type[Any] | Callable[[Any], Any],
91
- description: str,
94
+ description: str | Text,
92
95
  settable_object: object,
93
96
  *,
94
97
  settable_attrib_name: str | None = None,
@@ -108,7 +111,7 @@ class Settable:
108
111
  input is a valid integer. Specifying bool automatically provides
109
112
  completion for 'true' and 'false' and uses a built-in function
110
113
  for conversion and validation.
111
- :param description: A concise string that describes the purpose of this setting.
114
+ :param description: A concise string or rich Text object that describes the purpose of this setting.
112
115
  :param settable_object: The object that owns the attribute being made settable (e.g. self).
113
116
  :param settable_attrib_name: The name of the attribute on the settable_object that
114
117
  will be modified. This defaults to the value of the name
@@ -142,7 +145,7 @@ class Settable:
142
145
 
143
146
  self.name = name
144
147
  self.val_type = val_type
145
- self.description = description
148
+ self.description = ru.rich_text_to_string(description) if isinstance(description, Text) else description
146
149
  self.settable_obj = settable_object
147
150
  self.settable_attrib_name = settable_attrib_name if settable_attrib_name is not None else name
148
151
  self.onchange_cb = onchange_cb
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmd2
3
- Version: 4.1.1
3
+ Version: 4.1.2
4
4
  Summary: cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python
5
5
  Author: cmd2 Contributors
6
6
  License-Expression: MIT
@@ -128,7 +128,6 @@ examples/async_call.py
128
128
  examples/async_commands.py
129
129
  examples/async_printing.py
130
130
  examples/basic_completion.py
131
- examples/cmd2_history.dat
132
131
  examples/cmd_as_argument.py
133
132
  examples/color.py
134
133
  examples/command_sets.py
@@ -1,228 +1,228 @@
1
1
  {
2
2
  "files": [
3
+ ".coveragerc",
4
+ ".prettierignore",
5
+ ".prettierrc",
6
+ ".readthedocs.yaml",
7
+ "LICENSE",
8
+ "MANIFEST.in",
3
9
  "cmd2.png",
4
10
  "codecov.yml",
5
- "mkdocs.yml",
6
- "LICENSE",
7
- "CHANGELOG.md",
8
- ".pre-commit-config.yaml",
11
+ "package.json",
12
+ ".typos.toml",
9
13
  "Makefile",
14
+ "ruff.toml",
10
15
  "pyproject.toml",
11
- "MANIFEST.in",
12
- ".coveragerc",
13
- ".prettierignore",
14
- "README.md",
16
+ "mkdocs.yml",
15
17
  ".gitignore",
16
- "package.json",
17
- "ruff.toml",
18
- ".prettierrc",
19
18
  "GEMINI.md",
20
- ".typos.toml",
21
- ".readthedocs.yaml",
22
- "tests/test_parsing.py",
23
- "tests/test_commandset.py",
24
- "tests/test_utils.py",
25
- "tests/conftest.py",
26
- "tests/test_future_annotations.py",
27
- "tests/test_plugin.py",
28
- "tests/test_pt_utils.py",
29
- "tests/test_rich_utils.py",
30
- "tests/test_string_utils.py",
31
- "tests/test_annotated.py",
32
- "tests/__init__.py",
33
- "tests/test_argparse_completer.py",
34
- "tests/test_dynamic_complete_style.py",
35
- "tests/test_cmd2.py",
36
- "tests/test_categories.py",
37
- "tests/test_py_completion.py",
38
- "tests/test_theme.py",
39
- "tests/test_argparse_utils.py",
40
- "tests/test_run_pyscript.py",
41
- "tests/relative_multiple.txt",
42
- "tests/script.txt",
43
- "tests/test_argparse_subcommands.py",
44
- "tests/script.py",
45
- "tests/test_history.py",
46
- "tests/.cmd2rc",
47
- "tests/test_completion.py",
48
- "tests/test_utils_defining_class.py",
49
- "tests/test_argparse.py",
50
- "tests/scripts/empty.txt",
51
- "tests/scripts/nested.txt",
52
- "tests/scripts/postcmds.txt",
53
- "tests/scripts/utf8.txt",
54
- "tests/scripts/help.txt",
55
- "tests/scripts/one_down.txt",
56
- "tests/scripts/precmds.txt",
57
- "tests/scripts/binary.bin",
58
- "tests/pyscript/pyscript_dir.py",
59
- "tests/pyscript/test_print.py",
60
- "tests/pyscript/recursive.py",
61
- "tests/pyscript/stop.py",
62
- "tests/pyscript/self_in_py.py",
63
- "tests/pyscript/raises_exception.py",
64
- "tests/pyscript/environment.py",
65
- "tests/pyscript/py_locals.py",
66
- "tests/pyscript/help.py",
67
- "tests/pyscript/echo.py",
68
- "docs/upgrades.md",
69
- "docs/testing.md",
19
+ ".pre-commit-config.yaml",
20
+ "README.md",
21
+ "CHANGELOG.md",
22
+ ".github/CODE_OF_CONDUCT.md",
23
+ ".github/dependabot.yml",
24
+ ".github/CODEOWNERS",
25
+ ".github/CONTRIBUTING.md",
26
+ ".github/images/graph.drawio.png",
27
+ ".github/workflows/codeql-analysis.yml",
28
+ ".github/workflows/docs.yml",
29
+ ".github/workflows/tests.yml",
30
+ ".github/workflows/typecheck.yml",
31
+ ".github/workflows/quality.yml",
32
+ "cmd2/clipboard.py",
33
+ "cmd2/py.typed",
34
+ "cmd2/command_set.py",
35
+ "cmd2/exceptions.py",
36
+ "cmd2/history.py",
37
+ "cmd2/plugin.py",
38
+ "cmd2/types.py",
39
+ "cmd2/string_utils.py",
40
+ "cmd2/colors.py",
41
+ "cmd2/completion.py",
42
+ "cmd2/py_bridge.py",
43
+ "cmd2/rich_utils.py",
44
+ "cmd2/parsing.py",
45
+ "cmd2/argparse_completer.py",
46
+ "cmd2/constants.py",
47
+ "cmd2/decorators.py",
48
+ "cmd2/__init__.py",
49
+ "cmd2/annotated.py",
50
+ "cmd2/argparse_utils.py",
51
+ "cmd2/pt_utils.py",
52
+ "cmd2/styles.py",
53
+ "cmd2/theme.py",
54
+ "cmd2/utils.py",
55
+ "cmd2/cmd2.py",
70
56
  "docs/index.md",
57
+ "docs/testing.md",
71
58
  "docs/doc_conventions.md",
72
- "docs/overrides/main.html",
73
- "docs/migrating/next_steps.md",
74
- "docs/migrating/minimum.md",
75
- "docs/migrating/incompatibilities.md",
76
- "docs/migrating/index.md",
77
- "docs/migrating/why.md",
78
- "docs/mixins/mixin_template.md",
79
- "docs/mixins/index.md",
80
- "docs/features/generating_output.md",
81
- "docs/features/async_commands.md",
82
- "docs/features/settings.md",
83
- "docs/features/multiline_commands.md",
84
- "docs/features/embedded_python_shells.md",
85
- "docs/features/initialization.md",
86
- "docs/features/packaging.md",
87
- "docs/features/commands.md",
88
- "docs/features/annotated.md",
89
- "docs/features/history.md",
90
- "docs/features/prompt.md",
91
- "docs/features/modular_commands.md",
92
- "docs/features/help.md",
93
- "docs/features/builtin_commands.md",
94
- "docs/features/startup_commands.md",
95
- "docs/features/clipboard.md",
96
- "docs/features/argument_processing.md",
97
- "docs/features/shortcuts_aliases_macros.md",
98
- "docs/features/completion.md",
99
- "docs/features/index.md",
100
- "docs/features/theme.md",
101
- "docs/features/disable_commands.md",
102
- "docs/features/plugins.md",
103
- "docs/features/hooks.md",
104
- "docs/features/misc.md",
105
- "docs/features/os.md",
106
- "docs/features/table_creation.md",
107
- "docs/features/scripting.md",
108
- "docs/features/redirection.md",
109
- "docs/examples/examples.md",
110
- "docs/examples/getting_started.md",
111
- "docs/examples/index.md",
112
- "docs/examples/alternate_event_loops.md",
113
- "docs/javascripts/readthedocs.js",
59
+ "docs/upgrades.md",
114
60
  "docs/api/argparse_completer.md",
61
+ "docs/api/clipboard.md",
62
+ "docs/api/cmd.md",
63
+ "docs/api/colors.md",
64
+ "docs/api/constants.md",
65
+ "docs/api/decorators.md",
115
66
  "docs/api/exceptions.md",
67
+ "docs/api/history.md",
68
+ "docs/api/parsing.md",
116
69
  "docs/api/plugin.md",
117
- "docs/api/styles.md",
70
+ "docs/api/py_bridge.md",
118
71
  "docs/api/rich_utils.md",
119
72
  "docs/api/string_utils.md",
73
+ "docs/api/styles.md",
120
74
  "docs/api/utils.md",
121
- "docs/api/annotated.md",
122
- "docs/api/colors.md",
123
- "docs/api/decorators.md",
124
- "docs/api/history.md",
125
- "docs/api/clipboard.md",
126
- "docs/api/parsing.md",
127
- "docs/api/cmd.md",
75
+ "docs/api/argparse_utils.md",
76
+ "docs/api/command_set.md",
128
77
  "docs/api/completion.md",
78
+ "docs/api/pt_utils.md",
79
+ "docs/api/annotated.md",
129
80
  "docs/api/index.md",
130
81
  "docs/api/theme.md",
131
- "docs/api/command_set.md",
132
- "docs/api/pt_utils.md",
133
- "docs/api/argparse_utils.md",
134
- "docs/api/py_bridge.md",
135
- "docs/api/constants.md",
82
+ "docs/examples/examples.md",
83
+ "docs/examples/index.md",
84
+ "docs/examples/alternate_event_loops.md",
85
+ "docs/examples/getting_started.md",
86
+ "docs/features/clipboard.md",
87
+ "docs/features/commands.md",
88
+ "docs/features/disable_commands.md",
89
+ "docs/features/embedded_python_shells.md",
90
+ "docs/features/multiline_commands.md",
91
+ "docs/features/packaging.md",
92
+ "docs/features/plugins.md",
93
+ "docs/features/redirection.md",
94
+ "docs/features/scripting.md",
95
+ "docs/features/shortcuts_aliases_macros.md",
96
+ "docs/features/table_creation.md",
97
+ "docs/features/async_commands.md",
98
+ "docs/features/help.md",
99
+ "docs/features/history.md",
100
+ "docs/features/hooks.md",
101
+ "docs/features/misc.md",
102
+ "docs/features/os.md",
103
+ "docs/features/startup_commands.md",
104
+ "docs/features/builtin_commands.md",
105
+ "docs/features/completion.md",
106
+ "docs/features/settings.md",
107
+ "docs/features/generating_output.md",
108
+ "docs/features/theme.md",
109
+ "docs/features/index.md",
110
+ "docs/features/argument_processing.md",
111
+ "docs/features/modular_commands.md",
112
+ "docs/features/annotated.md",
113
+ "docs/features/initialization.md",
114
+ "docs/features/prompt.md",
115
+ "docs/javascripts/readthedocs.js",
116
+ "docs/migrating/minimum.md",
117
+ "docs/migrating/incompatibilities.md",
118
+ "docs/migrating/next_steps.md",
119
+ "docs/migrating/why.md",
120
+ "docs/migrating/index.md",
121
+ "docs/mixins/index.md",
122
+ "docs/mixins/mixin_template.md",
123
+ "docs/overrides/main.html",
124
+ "docs/overview/index.md",
136
125
  "docs/overview/resources.md",
137
126
  "docs/overview/alternatives.md",
138
127
  "docs/overview/integrating.md",
139
- "docs/overview/index.md",
140
128
  "docs/overview/installation.md",
141
129
  "docs/stylesheets/cmd2.css",
130
+ "examples/.cmd2rc",
131
+ "examples/tmux_launch.sh",
132
+ "examples/tmux_split.sh",
133
+ "examples/README.md",
134
+ "examples/argparse_completion.py",
135
+ "examples/basic_completion.py",
136
+ "examples/color.py",
137
+ "examples/custom_types.py",
138
+ "examples/default_categories.py",
139
+ "examples/dynamic_commands.py",
142
140
  "examples/event_loops.py",
143
141
  "examples/exit_code.py",
142
+ "examples/help_categories.py",
144
143
  "examples/hooks.py",
145
- "examples/python_scripting.py",
146
- "examples/color.py",
147
- "examples/rich_theme.py",
148
- "examples/getting_started.py",
149
- "examples/dynamic_commands.py",
150
- "examples/default_categories.py",
151
144
  "examples/mixin.py",
152
- "examples/pretty_print.py",
153
- "examples/paged_output.py",
154
145
  "examples/modular_commandsets.py",
155
- "examples/argparse_example.py",
156
- "examples/custom_parser.py",
157
- "examples/migrating.py",
158
- "examples/rich_tables.py",
159
- "examples/README.md",
160
- "examples/cmd_as_argument.py",
161
- "examples/async_call.py",
162
- "examples/hello_cmd2.py",
163
146
  "examples/persistent_history.py",
164
- "examples/basic_completion.py",
147
+ "examples/pretty_print.py",
148
+ "examples/python_scripting.py",
149
+ "examples/remove_builtin_commands.py",
165
150
  "examples/remove_settable.py",
166
- "examples/async_printing.py",
167
- "examples/tmux_launch.sh",
168
- "examples/annotated_example.py",
151
+ "examples/rich_tables.py",
152
+ "examples/unicode_commands.py",
169
153
  "examples/environment.py",
154
+ "examples/async_call.py",
170
155
  "examples/async_commands.py",
171
- "examples/custom_types.py",
172
- "examples/remove_builtin_commands.py",
173
- "examples/unicode_commands.py",
174
- "examples/argparse_completion.py",
175
- "examples/.cmd2rc",
176
- "examples/command_sets.py",
177
- "examples/help_categories.py",
156
+ "examples/cmd_as_argument.py",
178
157
  "examples/completion_item_choices.py",
158
+ "examples/migrating.py",
159
+ "examples/paged_output.py",
179
160
  "examples/read_input.py",
180
- "examples/tmux_split.sh",
181
- "examples/modular_commands/commandset_complex.py",
161
+ "examples/rich_theme.py",
162
+ "examples/argparse_example.py",
163
+ "examples/command_sets.py",
164
+ "examples/custom_parser.py",
165
+ "examples/annotated_example.py",
166
+ "examples/async_printing.py",
167
+ "examples/getting_started.py",
168
+ "examples/hello_cmd2.py",
169
+ "examples/modular_commands/__init__.py",
182
170
  "examples/modular_commands/commandset_basic.py",
171
+ "examples/modular_commands/commandset_complex.py",
183
172
  "examples/modular_commands/commandset_custominit.py",
184
- "examples/modular_commands/__init__.py",
185
- "examples/scripts/quit.txt",
186
173
  "examples/scripts/nested.txt",
187
- "examples/scripts/save_help_text.py",
188
- "examples/scripts/conditional.py",
174
+ "examples/scripts/quit.txt",
189
175
  "examples/scripts/script.txt",
190
- "examples/scripts/script.py",
191
176
  "examples/scripts/arg_printer.py",
177
+ "examples/scripts/script.py",
178
+ "examples/scripts/conditional.py",
179
+ "examples/scripts/save_help_text.py",
192
180
  "scripts/validate_tag.py",
193
- ".github/CODE_OF_CONDUCT.md",
194
- ".github/CODEOWNERS",
195
- ".github/CONTRIBUTING.md",
196
- ".github/dependabot.yml",
197
- ".github/images/graph.drawio.png",
198
- ".github/workflows/codeql-analysis.yml",
199
- ".github/workflows/typecheck.yml",
200
- ".github/workflows/docs.yml",
201
- ".github/workflows/quality.yml",
202
- ".github/workflows/tests.yml",
203
- "cmd2/pt_utils.py",
204
- "cmd2/parsing.py",
205
- "cmd2/command_set.py",
206
- "cmd2/theme.py",
207
- "cmd2/completion.py",
208
- "cmd2/py_bridge.py",
209
- "cmd2/constants.py",
210
- "cmd2/__init__.py",
211
- "cmd2/argparse_utils.py",
212
- "cmd2/types.py",
213
- "cmd2/rich_utils.py",
214
- "cmd2/string_utils.py",
215
- "cmd2/utils.py",
216
- "cmd2/argparse_completer.py",
217
- "cmd2/cmd2.py",
218
- "cmd2/styles.py",
219
- "cmd2/plugin.py",
220
- "cmd2/py.typed",
221
- "cmd2/exceptions.py",
222
- "cmd2/clipboard.py",
223
- "cmd2/annotated.py",
224
- "cmd2/history.py",
225
- "cmd2/colors.py",
226
- "cmd2/decorators.py"
181
+ "tests/.cmd2rc",
182
+ "tests/__init__.py",
183
+ "tests/relative_multiple.txt",
184
+ "tests/script.txt",
185
+ "tests/test_utils_defining_class.py",
186
+ "tests/script.py",
187
+ "tests/test_argparse_subcommands.py",
188
+ "tests/test_categories.py",
189
+ "tests/test_dynamic_complete_style.py",
190
+ "tests/test_future_annotations.py",
191
+ "tests/test_history.py",
192
+ "tests/test_parsing.py",
193
+ "tests/test_plugin.py",
194
+ "tests/test_py_completion.py",
195
+ "tests/test_string_utils.py",
196
+ "tests/conftest.py",
197
+ "tests/test_completion.py",
198
+ "tests/test_theme.py",
199
+ "tests/test_rich_utils.py",
200
+ "tests/test_run_pyscript.py",
201
+ "tests/test_argparse.py",
202
+ "tests/test_argparse_completer.py",
203
+ "tests/test_argparse_utils.py",
204
+ "tests/test_commandset.py",
205
+ "tests/test_utils.py",
206
+ "tests/test_annotated.py",
207
+ "tests/test_pt_utils.py",
208
+ "tests/test_cmd2.py",
209
+ "tests/pyscript/pyscript_dir.py",
210
+ "tests/pyscript/py_locals.py",
211
+ "tests/pyscript/echo.py",
212
+ "tests/pyscript/help.py",
213
+ "tests/pyscript/raises_exception.py",
214
+ "tests/pyscript/recursive.py",
215
+ "tests/pyscript/self_in_py.py",
216
+ "tests/pyscript/stop.py",
217
+ "tests/pyscript/environment.py",
218
+ "tests/pyscript/test_print.py",
219
+ "tests/scripts/binary.bin",
220
+ "tests/scripts/empty.txt",
221
+ "tests/scripts/help.txt",
222
+ "tests/scripts/nested.txt",
223
+ "tests/scripts/one_down.txt",
224
+ "tests/scripts/utf8.txt",
225
+ "tests/scripts/postcmds.txt",
226
+ "tests/scripts/precmds.txt"
227
227
  ]
228
228
  }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "4.1.2",
3
+ "distance": 0,
4
+ "node": "gcb4e6c59871e7a203754d3e3ddda61016eacb243",
5
+ "dirty": false,
6
+ "branch": "main",
7
+ "node_date": "2026-07-16"
8
+ }
@@ -13,7 +13,6 @@ import argparse
13
13
 
14
14
  import cmd2
15
15
  from cmd2 import (
16
- Cmd2ArgumentParser,
17
16
  CommandSet,
18
17
  with_argparser,
19
18
  with_category,
@@ -48,16 +47,16 @@ class CategoryApp(cmd2.Cmd):
48
47
  """A standard command defined in the child class."""
49
48
  self.poutput("Application command executed")
50
49
 
51
- @with_argparser(Cmd2ArgumentParser(description="Overridden quit command"))
52
- def do_quit(self, _: argparse.Namespace) -> bool | None:
50
+ @with_argparser(cmd2.Cmd._build_quit_parser)
51
+ def do_quit(self, args: argparse.Namespace) -> bool | None:
53
52
  """Overriding a built-in command without a decorator moves it to our category."""
54
- return super().do_quit("")
53
+ return super().do_quit(args.cmd2_statement)
55
54
 
56
55
  @with_category(cmd2.Cmd.DEFAULT_CATEGORY)
57
- @with_argparser(Cmd2ArgumentParser(description="Overridden shortcuts command"))
58
- def do_shortcuts(self, _: argparse.Namespace) -> None:
56
+ @with_argparser(cmd2.Cmd._build_shortcuts_parser)
57
+ def do_shortcuts(self, args: argparse.Namespace) -> None:
59
58
  """Overriding with @with_category(cmd2.Cmd.DEFAULT_CATEGORY) keeps it cmd2's category."""
60
- super().do_shortcuts("")
59
+ super().do_shortcuts(args.cmd2_statement)
61
60
 
62
61
 
63
62
  if __name__ == "__main__":