cmd2 4.1.0__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 (223) hide show
  1. {cmd2-4.1.0 → cmd2-4.1.2}/.pre-commit-config.yaml +2 -2
  2. {cmd2-4.1.0 → cmd2-4.1.2}/CHANGELOG.md +13 -0
  3. {cmd2-4.1.0 → cmd2-4.1.2}/PKG-INFO +1 -1
  4. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/argparse_utils.py +3 -3
  5. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/cmd2.py +39 -21
  6. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/utils.py +6 -3
  7. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/PKG-INFO +1 -1
  8. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/SOURCES.txt +0 -1
  9. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/scm_file_list.json +185 -185
  10. cmd2-4.1.2/cmd2.egg-info/scm_version.json +8 -0
  11. cmd2-4.1.2/examples/async_printing.py +181 -0
  12. {cmd2-4.1.0 → cmd2-4.1.2}/examples/default_categories.py +6 -7
  13. {cmd2-4.1.0 → cmd2-4.1.2}/examples/getting_started.py +28 -25
  14. {cmd2-4.1.0 → cmd2-4.1.2}/examples/hello_cmd2.py +2 -2
  15. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_cmd2.py +97 -8
  16. cmd2-4.1.0/cmd2.egg-info/scm_version.json +0 -8
  17. cmd2-4.1.0/examples/async_printing.py +0 -182
  18. cmd2-4.1.0/examples/cmd2_history.dat +0 -0
  19. {cmd2-4.1.0 → cmd2-4.1.2}/.prettierignore +0 -0
  20. {cmd2-4.1.0 → cmd2-4.1.2}/.prettierrc +0 -0
  21. {cmd2-4.1.0 → cmd2-4.1.2}/.typos.toml +0 -0
  22. {cmd2-4.1.0 → cmd2-4.1.2}/GEMINI.md +0 -0
  23. {cmd2-4.1.0 → cmd2-4.1.2}/LICENSE +0 -0
  24. {cmd2-4.1.0 → cmd2-4.1.2}/MANIFEST.in +0 -0
  25. {cmd2-4.1.0 → cmd2-4.1.2}/Makefile +0 -0
  26. {cmd2-4.1.0 → cmd2-4.1.2}/README.md +0 -0
  27. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/__init__.py +0 -0
  28. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/annotated.py +0 -0
  29. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/argparse_completer.py +0 -0
  30. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/clipboard.py +0 -0
  31. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/colors.py +0 -0
  32. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/command_set.py +0 -0
  33. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/completion.py +0 -0
  34. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/constants.py +0 -0
  35. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/decorators.py +0 -0
  36. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/exceptions.py +0 -0
  37. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/history.py +0 -0
  38. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/parsing.py +0 -0
  39. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/plugin.py +0 -0
  40. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/pt_utils.py +0 -0
  41. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/py.typed +0 -0
  42. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/py_bridge.py +0 -0
  43. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/rich_utils.py +0 -0
  44. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/string_utils.py +0 -0
  45. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/styles.py +0 -0
  46. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/theme.py +0 -0
  47. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2/types.py +0 -0
  48. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/dependency_links.txt +0 -0
  49. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/requires.txt +0 -0
  50. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.egg-info/top_level.txt +0 -0
  51. {cmd2-4.1.0 → cmd2-4.1.2}/cmd2.png +0 -0
  52. {cmd2-4.1.0 → cmd2-4.1.2}/codecov.yml +0 -0
  53. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/annotated.md +0 -0
  54. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/argparse_completer.md +0 -0
  55. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/argparse_utils.md +0 -0
  56. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/clipboard.md +0 -0
  57. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/cmd.md +0 -0
  58. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/colors.md +0 -0
  59. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/command_set.md +0 -0
  60. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/completion.md +0 -0
  61. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/constants.md +0 -0
  62. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/decorators.md +0 -0
  63. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/exceptions.md +0 -0
  64. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/history.md +0 -0
  65. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/index.md +0 -0
  66. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/parsing.md +0 -0
  67. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/plugin.md +0 -0
  68. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/pt_utils.md +0 -0
  69. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/py_bridge.md +0 -0
  70. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/rich_utils.md +0 -0
  71. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/string_utils.md +0 -0
  72. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/styles.md +0 -0
  73. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/theme.md +0 -0
  74. {cmd2-4.1.0 → cmd2-4.1.2}/docs/api/utils.md +0 -0
  75. {cmd2-4.1.0 → cmd2-4.1.2}/docs/doc_conventions.md +0 -0
  76. {cmd2-4.1.0 → cmd2-4.1.2}/docs/examples/alternate_event_loops.md +0 -0
  77. {cmd2-4.1.0 → cmd2-4.1.2}/docs/examples/examples.md +0 -0
  78. {cmd2-4.1.0 → cmd2-4.1.2}/docs/examples/getting_started.md +0 -0
  79. {cmd2-4.1.0 → cmd2-4.1.2}/docs/examples/index.md +0 -0
  80. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/annotated.md +0 -0
  81. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/argument_processing.md +0 -0
  82. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/async_commands.md +0 -0
  83. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/builtin_commands.md +0 -0
  84. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/clipboard.md +0 -0
  85. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/commands.md +0 -0
  86. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/completion.md +0 -0
  87. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/disable_commands.md +0 -0
  88. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/embedded_python_shells.md +0 -0
  89. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/generating_output.md +0 -0
  90. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/help.md +0 -0
  91. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/history.md +0 -0
  92. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/hooks.md +0 -0
  93. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/index.md +0 -0
  94. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/initialization.md +0 -0
  95. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/misc.md +0 -0
  96. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/modular_commands.md +0 -0
  97. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/multiline_commands.md +0 -0
  98. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/os.md +0 -0
  99. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/packaging.md +0 -0
  100. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/plugins.md +0 -0
  101. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/prompt.md +0 -0
  102. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/redirection.md +0 -0
  103. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/scripting.md +0 -0
  104. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/settings.md +0 -0
  105. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/shortcuts_aliases_macros.md +0 -0
  106. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/startup_commands.md +0 -0
  107. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/table_creation.md +0 -0
  108. {cmd2-4.1.0 → cmd2-4.1.2}/docs/features/theme.md +0 -0
  109. {cmd2-4.1.0 → cmd2-4.1.2}/docs/index.md +0 -0
  110. {cmd2-4.1.0 → cmd2-4.1.2}/docs/javascripts/readthedocs.js +0 -0
  111. {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/incompatibilities.md +0 -0
  112. {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/index.md +0 -0
  113. {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/minimum.md +0 -0
  114. {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/next_steps.md +0 -0
  115. {cmd2-4.1.0 → cmd2-4.1.2}/docs/migrating/why.md +0 -0
  116. {cmd2-4.1.0 → cmd2-4.1.2}/docs/mixins/index.md +0 -0
  117. {cmd2-4.1.0 → cmd2-4.1.2}/docs/mixins/mixin_template.md +0 -0
  118. {cmd2-4.1.0 → cmd2-4.1.2}/docs/overrides/main.html +0 -0
  119. {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/alternatives.md +0 -0
  120. {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/index.md +0 -0
  121. {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/installation.md +0 -0
  122. {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/integrating.md +0 -0
  123. {cmd2-4.1.0 → cmd2-4.1.2}/docs/overview/resources.md +0 -0
  124. {cmd2-4.1.0 → cmd2-4.1.2}/docs/stylesheets/cmd2.css +0 -0
  125. {cmd2-4.1.0 → cmd2-4.1.2}/docs/testing.md +0 -0
  126. {cmd2-4.1.0 → cmd2-4.1.2}/docs/upgrades.md +0 -0
  127. {cmd2-4.1.0 → cmd2-4.1.2}/examples/.cmd2rc +0 -0
  128. {cmd2-4.1.0 → cmd2-4.1.2}/examples/README.md +0 -0
  129. {cmd2-4.1.0 → cmd2-4.1.2}/examples/annotated_example.py +0 -0
  130. {cmd2-4.1.0 → cmd2-4.1.2}/examples/argparse_completion.py +0 -0
  131. {cmd2-4.1.0 → cmd2-4.1.2}/examples/argparse_example.py +0 -0
  132. {cmd2-4.1.0 → cmd2-4.1.2}/examples/async_call.py +0 -0
  133. {cmd2-4.1.0 → cmd2-4.1.2}/examples/async_commands.py +0 -0
  134. {cmd2-4.1.0 → cmd2-4.1.2}/examples/basic_completion.py +0 -0
  135. {cmd2-4.1.0 → cmd2-4.1.2}/examples/cmd_as_argument.py +0 -0
  136. {cmd2-4.1.0 → cmd2-4.1.2}/examples/color.py +0 -0
  137. {cmd2-4.1.0 → cmd2-4.1.2}/examples/command_sets.py +0 -0
  138. {cmd2-4.1.0 → cmd2-4.1.2}/examples/completion_item_choices.py +0 -0
  139. {cmd2-4.1.0 → cmd2-4.1.2}/examples/custom_parser.py +0 -0
  140. {cmd2-4.1.0 → cmd2-4.1.2}/examples/custom_types.py +0 -0
  141. {cmd2-4.1.0 → cmd2-4.1.2}/examples/dynamic_commands.py +0 -0
  142. {cmd2-4.1.0 → cmd2-4.1.2}/examples/environment.py +0 -0
  143. {cmd2-4.1.0 → cmd2-4.1.2}/examples/event_loops.py +0 -0
  144. {cmd2-4.1.0 → cmd2-4.1.2}/examples/exit_code.py +0 -0
  145. {cmd2-4.1.0 → cmd2-4.1.2}/examples/help_categories.py +0 -0
  146. {cmd2-4.1.0 → cmd2-4.1.2}/examples/hooks.py +0 -0
  147. {cmd2-4.1.0 → cmd2-4.1.2}/examples/migrating.py +0 -0
  148. {cmd2-4.1.0 → cmd2-4.1.2}/examples/mixin.py +0 -0
  149. {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commands/__init__.py +0 -0
  150. {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commands/commandset_basic.py +0 -0
  151. {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commands/commandset_complex.py +0 -0
  152. {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commands/commandset_custominit.py +0 -0
  153. {cmd2-4.1.0 → cmd2-4.1.2}/examples/modular_commandsets.py +0 -0
  154. {cmd2-4.1.0 → cmd2-4.1.2}/examples/paged_output.py +0 -0
  155. {cmd2-4.1.0 → cmd2-4.1.2}/examples/persistent_history.py +0 -0
  156. {cmd2-4.1.0 → cmd2-4.1.2}/examples/pretty_print.py +0 -0
  157. {cmd2-4.1.0 → cmd2-4.1.2}/examples/python_scripting.py +0 -0
  158. {cmd2-4.1.0 → cmd2-4.1.2}/examples/read_input.py +0 -0
  159. {cmd2-4.1.0 → cmd2-4.1.2}/examples/remove_builtin_commands.py +0 -0
  160. {cmd2-4.1.0 → cmd2-4.1.2}/examples/remove_settable.py +0 -0
  161. {cmd2-4.1.0 → cmd2-4.1.2}/examples/rich_tables.py +0 -0
  162. {cmd2-4.1.0 → cmd2-4.1.2}/examples/rich_theme.py +0 -0
  163. {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/arg_printer.py +0 -0
  164. {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/conditional.py +0 -0
  165. {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/nested.txt +0 -0
  166. {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/quit.txt +0 -0
  167. {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/save_help_text.py +0 -0
  168. {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/script.py +0 -0
  169. {cmd2-4.1.0 → cmd2-4.1.2}/examples/scripts/script.txt +0 -0
  170. {cmd2-4.1.0 → cmd2-4.1.2}/examples/tmux_launch.sh +0 -0
  171. {cmd2-4.1.0 → cmd2-4.1.2}/examples/tmux_split.sh +0 -0
  172. {cmd2-4.1.0 → cmd2-4.1.2}/examples/unicode_commands.py +0 -0
  173. {cmd2-4.1.0 → cmd2-4.1.2}/mkdocs.yml +0 -0
  174. {cmd2-4.1.0 → cmd2-4.1.2}/package.json +0 -0
  175. {cmd2-4.1.0 → cmd2-4.1.2}/pyproject.toml +0 -0
  176. {cmd2-4.1.0 → cmd2-4.1.2}/ruff.toml +0 -0
  177. {cmd2-4.1.0 → cmd2-4.1.2}/scripts/validate_tag.py +0 -0
  178. {cmd2-4.1.0 → cmd2-4.1.2}/setup.cfg +0 -0
  179. {cmd2-4.1.0 → cmd2-4.1.2}/tests/.cmd2rc +0 -0
  180. {cmd2-4.1.0 → cmd2-4.1.2}/tests/__init__.py +0 -0
  181. {cmd2-4.1.0 → cmd2-4.1.2}/tests/conftest.py +0 -0
  182. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/echo.py +0 -0
  183. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/environment.py +0 -0
  184. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/help.py +0 -0
  185. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/py_locals.py +0 -0
  186. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/pyscript_dir.py +0 -0
  187. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/raises_exception.py +0 -0
  188. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/recursive.py +0 -0
  189. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/self_in_py.py +0 -0
  190. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/stop.py +0 -0
  191. {cmd2-4.1.0 → cmd2-4.1.2}/tests/pyscript/test_print.py +0 -0
  192. {cmd2-4.1.0 → cmd2-4.1.2}/tests/relative_multiple.txt +0 -0
  193. {cmd2-4.1.0 → cmd2-4.1.2}/tests/script.py +0 -0
  194. {cmd2-4.1.0 → cmd2-4.1.2}/tests/script.txt +0 -0
  195. {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/binary.bin +0 -0
  196. {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/empty.txt +0 -0
  197. {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/help.txt +0 -0
  198. {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/nested.txt +0 -0
  199. {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/one_down.txt +0 -0
  200. {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/postcmds.txt +0 -0
  201. {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/precmds.txt +0 -0
  202. {cmd2-4.1.0 → cmd2-4.1.2}/tests/scripts/utf8.txt +0 -0
  203. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_annotated.py +0 -0
  204. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_argparse.py +0 -0
  205. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_argparse_completer.py +0 -0
  206. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_argparse_subcommands.py +0 -0
  207. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_argparse_utils.py +0 -0
  208. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_categories.py +0 -0
  209. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_commandset.py +0 -0
  210. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_completion.py +0 -0
  211. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_dynamic_complete_style.py +0 -0
  212. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_future_annotations.py +0 -0
  213. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_history.py +0 -0
  214. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_parsing.py +0 -0
  215. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_plugin.py +0 -0
  216. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_pt_utils.py +0 -0
  217. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_py_completion.py +0 -0
  218. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_rich_utils.py +0 -0
  219. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_run_pyscript.py +0 -0
  220. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_string_utils.py +0 -0
  221. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_theme.py +0 -0
  222. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_utils.py +0 -0
  223. {cmd2-4.1.0 → cmd2-4.1.2}/tests/test_utils_defining_class.py +0 -0
@@ -14,7 +14,7 @@ repos:
14
14
  - id: trailing-whitespace
15
15
 
16
16
  - repo: https://github.com/astral-sh/ruff-pre-commit
17
- rev: "v0.15.17"
17
+ rev: "v0.15.21"
18
18
  hooks:
19
19
  - id: ruff-format
20
20
  args: [--config=ruff.toml]
@@ -30,7 +30,7 @@ repos:
30
30
  - prettier-plugin-toml@2.0.6
31
31
 
32
32
  - repo: https://github.com/crate-ci/typos
33
- rev: v1.47.2
33
+ rev: v1.48.0
34
34
  hooks:
35
35
  - id: typos
36
36
  exclude: |
@@ -1,3 +1,16 @@
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
+
7
+ ## 4.1.1 (July 9, 2026)
8
+
9
+ - Bug Fixes
10
+ - Fixed a couple type issues that emerged with the upgrade to `mypy` 2.2.0
11
+ - Enhancements
12
+ - Async alert messages can now be Rich renderables.
13
+
1
14
  ## 4.1.0 (July 7, 2026)
2
15
 
3
16
  - Breaking Changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmd2
3
- Version: 4.1.0
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
@@ -1035,13 +1035,13 @@ class Cmd2ArgumentParser(argparse.ArgumentParser):
1035
1035
 
1036
1036
  self.exit(2, f"{formatted_message}\n")
1037
1037
 
1038
- def _get_formatter(self, **_kwargs: Any) -> Cmd2HelpFormatter:
1038
+ def _get_formatter(self, *_args: Any, **_kwargs: Any) -> Cmd2HelpFormatter:
1039
1039
  """Override with customizations for Cmd2HelpFormatter."""
1040
1040
  return self.formatter_class(prog=self.prog, file=self._thread_locals.current_output_file)
1041
1041
 
1042
- def format_help(self) -> str:
1042
+ def format_help(self, *args: Any, **kwargs: Any) -> str:
1043
1043
  """Override to add a newline."""
1044
- return super().format_help() + "\n"
1044
+ return super().format_help(*args, **kwargs) + "\n"
1045
1045
 
1046
1046
  def _get_nargs_pattern(self, action: argparse.Action) -> str:
1047
1047
  """Override to support nargs ranges."""
@@ -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]
@@ -312,7 +309,11 @@ class CommandParsers:
312
309
  class AsyncAlert:
313
310
  """Contents of an asynchronous alert which display while user is at prompt.
314
311
 
315
- :param msg: an optional message to be printed above the prompt.
312
+ :param msg: an optional printable object (including Rich renderables) to be
313
+ printed above the prompt.
314
+ :param soft_wrap: Enable soft wrap mode. This only applies with msg is not None.
315
+ Defaults to True. See print_to() docstring for more details on
316
+ this parameter.
316
317
  :param prompt: an optional string to dynamically replace the current prompt.
317
318
 
318
319
  :ivar timestamp: monotonic creation time of the alert. If an alert was created
@@ -320,7 +321,8 @@ class AsyncAlert:
320
321
  to avoid a stale display, but its msg data will still be displayed.
321
322
  """
322
323
 
323
- msg: str | None = None
324
+ msg: Any | None = None
325
+ soft_wrap: bool = True
324
326
  prompt: str | None = None
325
327
  timestamp: float = field(default_factory=time.monotonic, init=False)
326
328
 
@@ -1377,7 +1379,7 @@ class Cmd:
1377
1379
  Settable(
1378
1380
  "allow_style",
1379
1381
  allow_style_type,
1380
- ru.rich_text_to_string(settable_description),
1382
+ settable_description,
1381
1383
  self,
1382
1384
  choices_provider=get_allow_style_choices,
1383
1385
  )
@@ -1394,7 +1396,7 @@ class Cmd:
1394
1396
  Settable(
1395
1397
  "editor",
1396
1398
  str,
1397
- ru.rich_text_to_string(editor_description),
1399
+ editor_description,
1398
1400
  self,
1399
1401
  )
1400
1402
  )
@@ -1429,7 +1431,7 @@ class Cmd:
1429
1431
  Settable(
1430
1432
  "traceback_width",
1431
1433
  utils.optional_int,
1432
- ru.rich_text_to_string(traceback_width_description),
1434
+ traceback_width_description,
1433
1435
  self,
1434
1436
  )
1435
1437
  )
@@ -1572,7 +1574,7 @@ class Cmd:
1572
1574
  If False, Rich wraps text to fit the terminal width.
1573
1575
  Set this to False when printing structured Renderables like
1574
1576
  Tables, Panels, or Columns to ensure they render as expected.
1575
- For example, when soft_wrap is True Panels truncate text
1577
+ For example, when soft_wrap is True, Panels truncate text
1576
1578
  which is wider than the terminal.
1577
1579
  :param justify: justify method ("left", "center", "right", "full"). Defaults to None.
1578
1580
  :param emoji: If True, Rich will replace emoji codes (e.g., :smiley:) with their
@@ -3657,7 +3659,19 @@ class Cmd:
3657
3659
  # prevents async alerts from printing once a command starts.
3658
3660
 
3659
3661
  # Print all alerts at once to reduce flicker.
3660
- alert_text = "\n".join(alert.msg for alert in self._alert_queue if alert.msg)
3662
+ console = self._get_core_print_console(
3663
+ file=self.stdout,
3664
+ emoji=False,
3665
+ markup=False,
3666
+ highlight=False,
3667
+ )
3668
+
3669
+ with console.capture() as capture:
3670
+ for alert in self._alert_queue:
3671
+ if alert.msg is not None:
3672
+ console.print(alert.msg, soft_wrap=alert.soft_wrap)
3673
+
3674
+ alert_text = capture.get()
3661
3675
 
3662
3676
  # Find the latest prompt update among all pending alerts.
3663
3677
  latest_prompt = None
@@ -3681,7 +3695,7 @@ class Cmd:
3681
3695
  if alert_text:
3682
3696
  # Print the alert messages above the prompt.
3683
3697
  with patch_stdout():
3684
- print_formatted_text(pt_filter_style(alert_text))
3698
+ print_formatted_text(ANSI(alert_text), end="")
3685
3699
 
3686
3700
  elif latest_prompt is not None:
3687
3701
  # Refresh UI immediately to show the new prompt
@@ -5134,13 +5148,7 @@ class Cmd:
5134
5148
  # Detect whether IPython is installed
5135
5149
  try:
5136
5150
  import traitlets.config.loader as traitlets_loader
5137
-
5138
- # Allow users to install ipython from a cmd2 prompt when needed and still have ipy command work
5139
- try:
5140
- _dummy = start_ipython # noqa: F823
5141
- except NameError:
5142
- from IPython import start_ipython
5143
-
5151
+ from IPython import start_ipython
5144
5152
  from IPython.terminal.interactiveshell import TerminalInteractiveShell
5145
5153
  from IPython.terminal.ipapp import TerminalIPythonApp
5146
5154
  except ImportError:
@@ -5616,7 +5624,13 @@ class Cmd:
5616
5624
  # self.last_result will be set by do_run_script()
5617
5625
  return self.do_run_script(su.quote(relative_path))
5618
5626
 
5619
- def add_alert(self, *, msg: str | None = None, prompt: str | None = None) -> None:
5627
+ def add_alert(
5628
+ self,
5629
+ *,
5630
+ msg: Any | None = None,
5631
+ soft_wrap: bool = True,
5632
+ prompt: str | None = None,
5633
+ ) -> None:
5620
5634
  """Queue an asynchronous alert to be displayed when the prompt is active.
5621
5635
 
5622
5636
  Examples:
@@ -5624,7 +5638,11 @@ class Cmd:
5624
5638
  add_alert(prompt="user@host> ") # Update prompt only
5625
5639
  add_alert(msg="Done", prompt="> ") # Update both
5626
5640
 
5627
- :param msg: an optional message to be printed above the prompt.
5641
+ :param msg: an optional printable object (including Rich renderables) to be
5642
+ printed above the prompt.
5643
+ :param soft_wrap: Enable soft wrap mode. This only applies with msg is not None.
5644
+ Defaults to True. See print_to() docstring for more details on
5645
+ this parameter.
5628
5646
  :param prompt: an optional string to dynamically replace the current prompt.
5629
5647
 
5630
5648
  """
@@ -5632,7 +5650,7 @@ class Cmd:
5632
5650
  return
5633
5651
 
5634
5652
  with self._alert_condition:
5635
- alert = AsyncAlert(msg=msg, prompt=prompt)
5653
+ alert = AsyncAlert(msg=msg, soft_wrap=soft_wrap, prompt=prompt)
5636
5654
  self._alert_queue.append(alert)
5637
5655
  self._alert_condition.notify_all()
5638
5656
 
@@ -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.0
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