cmd2 3.2.2__tar.gz → 3.4.0__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 (229) hide show
  1. {cmd2-3.2.2 → cmd2-3.4.0}/CHANGELOG.md +25 -0
  2. {cmd2-3.2.2 → cmd2-3.4.0}/PKG-INFO +1 -1
  3. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/argparse_custom.py +2 -2
  4. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/cmd2.py +12 -12
  5. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/rich_utils.py +176 -17
  6. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2.egg-info/PKG-INFO +1 -1
  7. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2.egg-info/SOURCES.txt +1 -0
  8. cmd2-3.4.0/examples/cmd2_history.dat +0 -0
  9. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_cmd2.py +1 -3
  10. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_rich_utils.py +50 -0
  11. {cmd2-3.2.2 → cmd2-3.4.0}/.pre-commit-config.yaml +0 -0
  12. {cmd2-3.2.2 → cmd2-3.4.0}/.prettierignore +0 -0
  13. {cmd2-3.2.2 → cmd2-3.4.0}/.prettierrc +0 -0
  14. {cmd2-3.2.2 → cmd2-3.4.0}/GEMINI.md +0 -0
  15. {cmd2-3.2.2 → cmd2-3.4.0}/LICENSE +0 -0
  16. {cmd2-3.2.2 → cmd2-3.4.0}/MANIFEST.in +0 -0
  17. {cmd2-3.2.2 → cmd2-3.4.0}/Makefile +0 -0
  18. {cmd2-3.2.2 → cmd2-3.4.0}/README.md +0 -0
  19. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/__init__.py +0 -0
  20. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/argparse_completer.py +0 -0
  21. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/clipboard.py +0 -0
  22. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/colors.py +0 -0
  23. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/command_definition.py +0 -0
  24. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/constants.py +0 -0
  25. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/decorators.py +0 -0
  26. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/exceptions.py +0 -0
  27. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/history.py +0 -0
  28. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/parsing.py +0 -0
  29. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/plugin.py +0 -0
  30. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/py.typed +0 -0
  31. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/py_bridge.py +0 -0
  32. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/rl_utils.py +0 -0
  33. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/string_utils.py +0 -0
  34. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/styles.py +0 -0
  35. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/terminal_utils.py +0 -0
  36. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/transcript.py +0 -0
  37. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2/utils.py +0 -0
  38. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2.egg-info/dependency_links.txt +0 -0
  39. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2.egg-info/requires.txt +0 -0
  40. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2.egg-info/top_level.txt +0 -0
  41. {cmd2-3.2.2 → cmd2-3.4.0}/cmd2.png +0 -0
  42. {cmd2-3.2.2 → cmd2-3.4.0}/codecov.yml +0 -0
  43. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/argparse_completer.md +0 -0
  44. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/argparse_custom.md +0 -0
  45. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/clipboard.md +0 -0
  46. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/cmd.md +0 -0
  47. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/colors.md +0 -0
  48. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/command_definition.md +0 -0
  49. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/constants.md +0 -0
  50. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/decorators.md +0 -0
  51. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/exceptions.md +0 -0
  52. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/history.md +0 -0
  53. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/index.md +0 -0
  54. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/parsing.md +0 -0
  55. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/plugin.md +0 -0
  56. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/py_bridge.md +0 -0
  57. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/rich_utils.md +0 -0
  58. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/rl_utils.md +0 -0
  59. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/string_utils.md +0 -0
  60. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/styles.md +0 -0
  61. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/terminal_utils.md +0 -0
  62. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/transcript.md +0 -0
  63. {cmd2-3.2.2 → cmd2-3.4.0}/docs/api/utils.md +0 -0
  64. {cmd2-3.2.2 → cmd2-3.4.0}/docs/doc_conventions.md +0 -0
  65. {cmd2-3.2.2 → cmd2-3.4.0}/docs/examples/alternate_event_loops.md +0 -0
  66. {cmd2-3.2.2 → cmd2-3.4.0}/docs/examples/examples.md +0 -0
  67. {cmd2-3.2.2 → cmd2-3.4.0}/docs/examples/getting_started.md +0 -0
  68. {cmd2-3.2.2 → cmd2-3.4.0}/docs/examples/index.md +0 -0
  69. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/argument_processing.md +0 -0
  70. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/builtin_commands.md +0 -0
  71. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/clipboard.md +0 -0
  72. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/commands.md +0 -0
  73. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/completion.md +0 -0
  74. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/disable_commands.md +0 -0
  75. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/embedded_python_shells.md +0 -0
  76. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/generating_output.md +0 -0
  77. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/help.md +0 -0
  78. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/history.md +0 -0
  79. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/hooks.md +0 -0
  80. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/index.md +0 -0
  81. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/initialization.md +0 -0
  82. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/misc.md +0 -0
  83. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/modular_commands.md +0 -0
  84. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/multiline_commands.md +0 -0
  85. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/os.md +0 -0
  86. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/packaging.md +0 -0
  87. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/plugins.md +0 -0
  88. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/prompt.md +0 -0
  89. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/redirection.md +0 -0
  90. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/scripting.md +0 -0
  91. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/settings.md +0 -0
  92. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/shortcuts_aliases_macros.md +0 -0
  93. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/startup_commands.md +0 -0
  94. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/table_creation.md +0 -0
  95. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/theme.md +0 -0
  96. {cmd2-3.2.2 → cmd2-3.4.0}/docs/features/transcripts.md +0 -0
  97. {cmd2-3.2.2 → cmd2-3.4.0}/docs/index.md +0 -0
  98. {cmd2-3.2.2 → cmd2-3.4.0}/docs/javascripts/readthedocs.js +0 -0
  99. {cmd2-3.2.2 → cmd2-3.4.0}/docs/migrating/incompatibilities.md +0 -0
  100. {cmd2-3.2.2 → cmd2-3.4.0}/docs/migrating/index.md +0 -0
  101. {cmd2-3.2.2 → cmd2-3.4.0}/docs/migrating/minimum.md +0 -0
  102. {cmd2-3.2.2 → cmd2-3.4.0}/docs/migrating/next_steps.md +0 -0
  103. {cmd2-3.2.2 → cmd2-3.4.0}/docs/migrating/why.md +0 -0
  104. {cmd2-3.2.2 → cmd2-3.4.0}/docs/mixins/index.md +0 -0
  105. {cmd2-3.2.2 → cmd2-3.4.0}/docs/mixins/mixin_template.md +0 -0
  106. {cmd2-3.2.2 → cmd2-3.4.0}/docs/overrides/main.html +0 -0
  107. {cmd2-3.2.2 → cmd2-3.4.0}/docs/overview/alternatives.md +0 -0
  108. {cmd2-3.2.2 → cmd2-3.4.0}/docs/overview/index.md +0 -0
  109. {cmd2-3.2.2 → cmd2-3.4.0}/docs/overview/installation.md +0 -0
  110. {cmd2-3.2.2 → cmd2-3.4.0}/docs/overview/integrating.md +0 -0
  111. {cmd2-3.2.2 → cmd2-3.4.0}/docs/overview/resources.md +0 -0
  112. {cmd2-3.2.2 → cmd2-3.4.0}/docs/stylesheets/cmd2.css +0 -0
  113. {cmd2-3.2.2 → cmd2-3.4.0}/docs/testing.md +0 -0
  114. {cmd2-3.2.2 → cmd2-3.4.0}/docs/upgrades.md +0 -0
  115. {cmd2-3.2.2 → cmd2-3.4.0}/examples/.cmd2rc +0 -0
  116. {cmd2-3.2.2 → cmd2-3.4.0}/examples/README.md +0 -0
  117. {cmd2-3.2.2 → cmd2-3.4.0}/examples/argparse_completion.py +0 -0
  118. {cmd2-3.2.2 → cmd2-3.4.0}/examples/argparse_example.py +0 -0
  119. {cmd2-3.2.2 → cmd2-3.4.0}/examples/async_call.py +0 -0
  120. {cmd2-3.2.2 → cmd2-3.4.0}/examples/async_printing.py +0 -0
  121. {cmd2-3.2.2 → cmd2-3.4.0}/examples/basic_completion.py +0 -0
  122. {cmd2-3.2.2 → cmd2-3.4.0}/examples/cmd_as_argument.py +0 -0
  123. {cmd2-3.2.2 → cmd2-3.4.0}/examples/color.py +0 -0
  124. {cmd2-3.2.2 → cmd2-3.4.0}/examples/command_sets.py +0 -0
  125. {cmd2-3.2.2 → cmd2-3.4.0}/examples/custom_parser.py +0 -0
  126. {cmd2-3.2.2 → cmd2-3.4.0}/examples/custom_types.py +0 -0
  127. {cmd2-3.2.2 → cmd2-3.4.0}/examples/default_categories.py +0 -0
  128. {cmd2-3.2.2 → cmd2-3.4.0}/examples/dynamic_commands.py +0 -0
  129. {cmd2-3.2.2 → cmd2-3.4.0}/examples/environment.py +0 -0
  130. {cmd2-3.2.2 → cmd2-3.4.0}/examples/event_loops.py +0 -0
  131. {cmd2-3.2.2 → cmd2-3.4.0}/examples/exit_code.py +0 -0
  132. {cmd2-3.2.2 → cmd2-3.4.0}/examples/getting_started.py +0 -0
  133. {cmd2-3.2.2 → cmd2-3.4.0}/examples/hello_cmd2.py +0 -0
  134. {cmd2-3.2.2 → cmd2-3.4.0}/examples/help_categories.py +0 -0
  135. {cmd2-3.2.2 → cmd2-3.4.0}/examples/hooks.py +0 -0
  136. {cmd2-3.2.2 → cmd2-3.4.0}/examples/migrating.py +0 -0
  137. {cmd2-3.2.2 → cmd2-3.4.0}/examples/mixin.py +0 -0
  138. {cmd2-3.2.2 → cmd2-3.4.0}/examples/modular_commands/__init__.py +0 -0
  139. {cmd2-3.2.2 → cmd2-3.4.0}/examples/modular_commands/commandset_basic.py +0 -0
  140. {cmd2-3.2.2 → cmd2-3.4.0}/examples/modular_commands/commandset_complex.py +0 -0
  141. {cmd2-3.2.2 → cmd2-3.4.0}/examples/modular_commands/commandset_custominit.py +0 -0
  142. {cmd2-3.2.2 → cmd2-3.4.0}/examples/modular_commands.py +0 -0
  143. {cmd2-3.2.2 → cmd2-3.4.0}/examples/paged_output.py +0 -0
  144. {cmd2-3.2.2 → cmd2-3.4.0}/examples/persistent_history.py +0 -0
  145. {cmd2-3.2.2 → cmd2-3.4.0}/examples/pretty_print.py +0 -0
  146. {cmd2-3.2.2 → cmd2-3.4.0}/examples/python_scripting.py +0 -0
  147. {cmd2-3.2.2 → cmd2-3.4.0}/examples/read_input.py +0 -0
  148. {cmd2-3.2.2 → cmd2-3.4.0}/examples/remove_builtin_commands.py +0 -0
  149. {cmd2-3.2.2 → cmd2-3.4.0}/examples/remove_settable.py +0 -0
  150. {cmd2-3.2.2 → cmd2-3.4.0}/examples/rich_tables.py +0 -0
  151. {cmd2-3.2.2 → cmd2-3.4.0}/examples/rich_theme.py +0 -0
  152. {cmd2-3.2.2 → cmd2-3.4.0}/examples/scripts/arg_printer.py +0 -0
  153. {cmd2-3.2.2 → cmd2-3.4.0}/examples/scripts/conditional.py +0 -0
  154. {cmd2-3.2.2 → cmd2-3.4.0}/examples/scripts/nested.txt +0 -0
  155. {cmd2-3.2.2 → cmd2-3.4.0}/examples/scripts/quit.txt +0 -0
  156. {cmd2-3.2.2 → cmd2-3.4.0}/examples/scripts/save_help_text.py +0 -0
  157. {cmd2-3.2.2 → cmd2-3.4.0}/examples/scripts/script.py +0 -0
  158. {cmd2-3.2.2 → cmd2-3.4.0}/examples/scripts/script.txt +0 -0
  159. {cmd2-3.2.2 → cmd2-3.4.0}/examples/tmux_launch.sh +0 -0
  160. {cmd2-3.2.2 → cmd2-3.4.0}/examples/tmux_split.sh +0 -0
  161. {cmd2-3.2.2 → cmd2-3.4.0}/examples/transcript_example.py +0 -0
  162. {cmd2-3.2.2 → cmd2-3.4.0}/examples/transcripts/exampleSession.txt +0 -0
  163. {cmd2-3.2.2 → cmd2-3.4.0}/examples/transcripts/pirate.transcript +0 -0
  164. {cmd2-3.2.2 → cmd2-3.4.0}/examples/transcripts/quit.txt +0 -0
  165. {cmd2-3.2.2 → cmd2-3.4.0}/examples/transcripts/transcript_regex.txt +0 -0
  166. {cmd2-3.2.2 → cmd2-3.4.0}/examples/unicode_commands.py +0 -0
  167. {cmd2-3.2.2 → cmd2-3.4.0}/mkdocs.yml +0 -0
  168. {cmd2-3.2.2 → cmd2-3.4.0}/package.json +0 -0
  169. {cmd2-3.2.2 → cmd2-3.4.0}/pyproject.toml +0 -0
  170. {cmd2-3.2.2 → cmd2-3.4.0}/ruff.toml +0 -0
  171. {cmd2-3.2.2 → cmd2-3.4.0}/scripts/validate_tag.py +0 -0
  172. {cmd2-3.2.2 → cmd2-3.4.0}/setup.cfg +0 -0
  173. {cmd2-3.2.2 → cmd2-3.4.0}/tests/.cmd2rc +0 -0
  174. {cmd2-3.2.2 → cmd2-3.4.0}/tests/__init__.py +0 -0
  175. {cmd2-3.2.2 → cmd2-3.4.0}/tests/conftest.py +0 -0
  176. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/echo.py +0 -0
  177. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/environment.py +0 -0
  178. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/help.py +0 -0
  179. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/py_locals.py +0 -0
  180. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/pyscript_dir.py +0 -0
  181. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/raises_exception.py +0 -0
  182. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/recursive.py +0 -0
  183. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/self_in_py.py +0 -0
  184. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/stdout_capture.py +0 -0
  185. {cmd2-3.2.2 → cmd2-3.4.0}/tests/pyscript/stop.py +0 -0
  186. {cmd2-3.2.2 → cmd2-3.4.0}/tests/relative_multiple.txt +0 -0
  187. {cmd2-3.2.2 → cmd2-3.4.0}/tests/script.py +0 -0
  188. {cmd2-3.2.2 → cmd2-3.4.0}/tests/script.txt +0 -0
  189. {cmd2-3.2.2 → cmd2-3.4.0}/tests/scripts/binary.bin +0 -0
  190. {cmd2-3.2.2 → cmd2-3.4.0}/tests/scripts/empty.txt +0 -0
  191. {cmd2-3.2.2 → cmd2-3.4.0}/tests/scripts/help.txt +0 -0
  192. {cmd2-3.2.2 → cmd2-3.4.0}/tests/scripts/nested.txt +0 -0
  193. {cmd2-3.2.2 → cmd2-3.4.0}/tests/scripts/one_down.txt +0 -0
  194. {cmd2-3.2.2 → cmd2-3.4.0}/tests/scripts/postcmds.txt +0 -0
  195. {cmd2-3.2.2 → cmd2-3.4.0}/tests/scripts/precmds.txt +0 -0
  196. {cmd2-3.2.2 → cmd2-3.4.0}/tests/scripts/utf8.txt +0 -0
  197. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_argparse.py +0 -0
  198. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_argparse_completer.py +0 -0
  199. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_argparse_custom.py +0 -0
  200. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_argparse_subcommands.py +0 -0
  201. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_async_alert.py +0 -0
  202. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_categories.py +0 -0
  203. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_commandset.py +0 -0
  204. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_completion.py +0 -0
  205. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_future_annotations.py +0 -0
  206. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_history.py +0 -0
  207. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_parsing.py +0 -0
  208. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_plugin.py +0 -0
  209. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_run_pyscript.py +0 -0
  210. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_string_utils.py +0 -0
  211. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_terminal_utils.py +0 -0
  212. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_transcript.py +0 -0
  213. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_utils.py +0 -0
  214. {cmd2-3.2.2 → cmd2-3.4.0}/tests/test_utils_defining_class.py +0 -0
  215. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/bol_eol.txt +0 -0
  216. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/characterclass.txt +0 -0
  217. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/dotstar.txt +0 -0
  218. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/extension_notation.txt +0 -0
  219. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/failure.txt +0 -0
  220. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/from_cmdloop.txt +0 -0
  221. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/multiline_no_regex.txt +0 -0
  222. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/multiline_regex.txt +0 -0
  223. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/no_output.txt +0 -0
  224. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/no_output_last.txt +0 -0
  225. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/singleslash.txt +0 -0
  226. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/slashes_escaped.txt +0 -0
  227. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/slashslash.txt +0 -0
  228. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/spaces.txt +0 -0
  229. {cmd2-3.2.2 → cmd2-3.4.0}/tests/transcripts/word_boundaries.txt +0 -0
@@ -1,3 +1,28 @@
1
+ ## 3.4.0 (March 3, 2026)
2
+
3
+ - Enhancements
4
+ - Moved cmd2-specific printing logic from `Cmd.print_to()` into `Cmd2BaseConsole.print()` and
5
+ `Cmd2BaseConsole.log()`. This removes need to pass a console object to `Cmd.print_to()`.
6
+ - Addressed a bug in `rich.console.Console` where complex renderables (like `Table` and `Rule`)
7
+ may not receive formatting settings passed to `console.print()` and `console.log()`.
8
+
9
+ - Breaking Changes
10
+ - Renamed the `destination` parameter of `Cmd.print_to()` back to `file` since you can no longer
11
+ pass in a console.
12
+
13
+ ## 3.3.0 (March 1, 2026)
14
+
15
+ - Enhancements
16
+ - Added ability to pass a console object to `Cmd.print_to()`. This provides support for things
17
+ like wrapping a `print_to()` call in a `console.status()` or `console.capture()` context
18
+ manager.
19
+
20
+ - Breaking Changes
21
+ - Renamed the `file` parameter of `Cmd.print_to()` to `destination` to support file-like objects
22
+ and console objects.
23
+ - `Cmd2BaseConsole(file)` argument is now a keyword-only argument to be consistent with the
24
+ `rich.console.Console` class.
25
+
1
26
  ## 3.2.2 (February 21, 2026)
2
27
 
3
28
  - Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmd2
3
- Version: 3.2.2
3
+ Version: 3.4.0
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
@@ -1361,10 +1361,10 @@ class Cmd2ArgumentParser(argparse.ArgumentParser):
1361
1361
 
1362
1362
  self.print_usage(sys.stderr)
1363
1363
 
1364
- # Add error style to message
1364
+ # Use console to add style since it will respect ALLOW_STYLE's value
1365
1365
  console = self._get_formatter().console
1366
1366
  with console.capture() as capture:
1367
- console.print(formatted_message, style=Cmd2Style.ERROR, crop=False)
1367
+ console.print(formatted_message, style=Cmd2Style.ERROR)
1368
1368
  formatted_message = f"{capture.get()}"
1369
1369
 
1370
1370
  self.exit(2, f'{formatted_message}\n')
@@ -65,7 +65,10 @@ from typing import (
65
65
  )
66
66
 
67
67
  import rich.box
68
- from rich.console import Group, RenderableType
68
+ from rich.console import (
69
+ Group,
70
+ RenderableType,
71
+ )
69
72
  from rich.highlighter import ReprHighlighter
70
73
  from rich.rule import Rule
71
74
  from rich.style import Style, StyleType
@@ -133,6 +136,7 @@ from .parsing import (
133
136
  shlex_split,
134
137
  )
135
138
  from .rich_utils import (
139
+ Cmd2BaseConsole,
136
140
  Cmd2ExceptionConsole,
137
141
  Cmd2GeneralConsole,
138
142
  RichPrintKwargs,
@@ -165,7 +169,7 @@ from .utils import (
165
169
 
166
170
  # Set up readline
167
171
  if rl_type == RlType.NONE: # pragma: no cover
168
- Cmd2GeneralConsole(sys.stderr).print(rl_warning, style=Cmd2Style.WARNING)
172
+ Cmd2GeneralConsole(file=sys.stderr).print(rl_warning, style=Cmd2Style.WARNING)
169
173
  else:
170
174
  from .rl_utils import (
171
175
  readline,
@@ -1293,11 +1297,9 @@ class Cmd:
1293
1297
 
1294
1298
  See the Rich documentation for more details on emoji codes, markup tags, and highlighting.
1295
1299
  """
1296
- prepared_objects = ru.prepare_objects_for_rendering(*objects)
1297
-
1298
1300
  try:
1299
- Cmd2GeneralConsole(file).print(
1300
- *prepared_objects,
1301
+ Cmd2BaseConsole(file=file).print(
1302
+ *objects,
1301
1303
  sep=sep,
1302
1304
  end=end,
1303
1305
  style=style,
@@ -1314,7 +1316,7 @@ class Cmd:
1314
1316
  # warning message, then set the broken_pipe_warning attribute
1315
1317
  # to the message you want printed.
1316
1318
  if self.broken_pipe_warning and file != sys.stderr:
1317
- Cmd2GeneralConsole(sys.stderr).print(self.broken_pipe_warning)
1319
+ Cmd2GeneralConsole(file=sys.stderr).print(self.broken_pipe_warning)
1318
1320
 
1319
1321
  def poutput(
1320
1322
  self,
@@ -1447,7 +1449,7 @@ class Cmd:
1447
1449
  :param kwargs: Arbitrary keyword arguments. This allows subclasses to extend the signature of this
1448
1450
  method and still call `super()` without encountering unexpected keyword argument errors.
1449
1451
  """
1450
- console = Cmd2ExceptionConsole(sys.stderr)
1452
+ console = Cmd2ExceptionConsole(file=sys.stderr)
1451
1453
 
1452
1454
  # Only print a traceback if we're in debug mode and one exists.
1453
1455
  if self.debug and sys.exc_info() != (None, None, None):
@@ -1581,17 +1583,15 @@ class Cmd:
1581
1583
 
1582
1584
  # Check if we are outputting to a pager.
1583
1585
  if functional_terminal and can_block:
1584
- prepared_objects = ru.prepare_objects_for_rendering(*objects)
1585
-
1586
1586
  # Chopping overrides soft_wrap
1587
1587
  if chop:
1588
1588
  soft_wrap = True
1589
1589
 
1590
1590
  # Generate the bytes to send to the pager
1591
- console = Cmd2GeneralConsole(self.stdout)
1591
+ console = Cmd2BaseConsole(file=self.stdout)
1592
1592
  with console.capture() as capture:
1593
1593
  console.print(
1594
- *prepared_objects,
1594
+ *objects,
1595
1595
  sep=sep,
1596
1596
  end=end,
1597
1597
  style=style,
@@ -1,6 +1,7 @@
1
1
  """Provides common utilities to support Rich in cmd2-based applications."""
2
2
 
3
3
  import re
4
+ import threading
4
5
  from collections.abc import Mapping
5
6
  from enum import Enum
6
7
  from typing import (
@@ -124,6 +125,7 @@ class Cmd2BaseConsole(Console):
124
125
 
125
126
  def __init__(
126
127
  self,
128
+ *,
127
129
  file: IO[str] | None = None,
128
130
  **kwargs: Any,
129
131
  ) -> None:
@@ -172,25 +174,167 @@ class Cmd2BaseConsole(Console):
172
174
  theme=APP_THEME,
173
175
  **kwargs,
174
176
  )
177
+ self._thread_local = threading.local()
175
178
 
176
179
  def on_broken_pipe(self) -> None:
177
180
  """Override which raises BrokenPipeError instead of SystemExit."""
178
181
  self.quiet = True
179
182
  raise BrokenPipeError
180
183
 
184
+ def render_str(
185
+ self,
186
+ text: str,
187
+ highlight: bool | None = None,
188
+ markup: bool | None = None,
189
+ emoji: bool | None = None,
190
+ **kwargs: Any,
191
+ ) -> Text:
192
+ """Override to ensure formatting overrides passed to print() and log() are respected."""
193
+ if emoji is None:
194
+ emoji = getattr(self._thread_local, "emoji", None)
195
+ if markup is None:
196
+ markup = getattr(self._thread_local, "markup", None)
197
+ if highlight is None:
198
+ highlight = getattr(self._thread_local, "highlight", None)
199
+
200
+ return super().render_str(text, highlight=highlight, markup=markup, emoji=emoji, **kwargs)
201
+
202
+ def print(
203
+ self,
204
+ *objects: Any,
205
+ sep: str = " ",
206
+ end: str = "\n",
207
+ style: StyleType | None = None,
208
+ justify: JustifyMethod | None = None,
209
+ overflow: OverflowMethod | None = None,
210
+ no_wrap: bool | None = None,
211
+ emoji: bool | None = None,
212
+ markup: bool | None = None,
213
+ highlight: bool | None = None,
214
+ width: int | None = None,
215
+ height: int | None = None,
216
+ crop: bool = True,
217
+ soft_wrap: bool | None = None,
218
+ new_line_start: bool = False,
219
+ ) -> None:
220
+ """Override to support ANSI sequences and address a bug in Rich.
221
+
222
+ This method calls [cmd2.rich_utils.prepare_objects_for_rendering][] on the
223
+ objects being printed. This ensures that strings containing ANSI style
224
+ sequences are converted to Rich Text objects, so that Rich can correctly
225
+ calculate their display width.
226
+
227
+ Additionally, it works around a bug in Rich where complex renderables
228
+ (like Table and Rule) may not receive formatting settings passed to print().
229
+ By temporarily injecting these settings into thread-local storage, we ensure
230
+ that all internal rendering calls within the print() operation respect the
231
+ requested overrides.
232
+
233
+ There is an issue on Rich to fix the latter:
234
+ https://github.com/Textualize/rich/issues/4028
235
+ """
236
+ prepared_objects = prepare_objects_for_rendering(*objects)
237
+
238
+ # Inject overrides into thread-local storage
239
+ self._thread_local.emoji = emoji
240
+ self._thread_local.markup = markup
241
+ self._thread_local.highlight = highlight
242
+
243
+ try:
244
+ super().print(
245
+ *prepared_objects,
246
+ sep=sep,
247
+ end=end,
248
+ style=style,
249
+ justify=justify,
250
+ overflow=overflow,
251
+ no_wrap=no_wrap,
252
+ emoji=emoji,
253
+ markup=markup,
254
+ highlight=highlight,
255
+ width=width,
256
+ height=height,
257
+ crop=crop,
258
+ soft_wrap=soft_wrap,
259
+ new_line_start=new_line_start,
260
+ )
261
+ finally:
262
+ # Clear overrides from thread-local storage
263
+ self._thread_local.emoji = None
264
+ self._thread_local.markup = None
265
+ self._thread_local.highlight = None
266
+
267
+ def log(
268
+ self,
269
+ *objects: Any,
270
+ sep: str = " ",
271
+ end: str = "\n",
272
+ style: StyleType | None = None,
273
+ justify: JustifyMethod | None = None,
274
+ emoji: bool | None = None,
275
+ markup: bool | None = None,
276
+ highlight: bool | None = None,
277
+ log_locals: bool = False,
278
+ _stack_offset: int = 1,
279
+ ) -> None:
280
+ """Override to support ANSI sequences and address a bug in Rich.
281
+
282
+ This method calls [cmd2.rich_utils.prepare_objects_for_rendering][] on the
283
+ objects being logged. This ensures that strings containing ANSI style
284
+ sequences are converted to Rich Text objects, so that Rich can correctly
285
+ calculate their display width.
286
+
287
+ Additionally, it works around a bug in Rich where complex renderables
288
+ (like Table and Rule) may not receive formatting settings passed to log().
289
+ By temporarily injecting these settings into thread-local storage, we ensure
290
+ that all internal rendering calls within the log() operation respect the
291
+ requested overrides.
292
+
293
+ There is an issue on Rich to fix the latter:
294
+ https://github.com/Textualize/rich/issues/4028
295
+ """
296
+ prepared_objects = prepare_objects_for_rendering(*objects)
297
+
298
+ # Inject overrides into thread-local storage
299
+ self._thread_local.emoji = emoji
300
+ self._thread_local.markup = markup
301
+ self._thread_local.highlight = highlight
302
+
303
+ try:
304
+ # Increment _stack_offset because we added this wrapper frame
305
+ super().log(
306
+ *prepared_objects,
307
+ sep=sep,
308
+ end=end,
309
+ style=style,
310
+ justify=justify,
311
+ emoji=emoji,
312
+ markup=markup,
313
+ highlight=highlight,
314
+ log_locals=log_locals,
315
+ _stack_offset=_stack_offset + 1,
316
+ )
317
+ finally:
318
+ # Clear overrides from thread-local storage
319
+ self._thread_local.emoji = None
320
+ self._thread_local.markup = None
321
+ self._thread_local.highlight = None
322
+
181
323
 
182
324
  class Cmd2GeneralConsole(Cmd2BaseConsole):
183
- """Rich console for general-purpose printing."""
325
+ """Rich console for general-purpose printing.
326
+
327
+ It enables soft wrap and disables Rich's automatic detection for markup,
328
+ emoji, and highlighting. These defaults can be overridden in calls to the
329
+ console's or cmd2's print methods.
330
+ """
184
331
 
185
- def __init__(self, file: IO[str] | None = None) -> None:
332
+ def __init__(self, *, file: IO[str] | None = None) -> None:
186
333
  """Cmd2GeneralConsole initializer.
187
334
 
188
335
  :param file: optional file object where the console should write to.
189
336
  Defaults to sys.stdout.
190
337
  """
191
- # This console is configured for general-purpose printing. It enables soft wrap
192
- # and disables Rich's automatic detection for markup, emoji, and highlighting.
193
- # These defaults can be overridden in calls to the console's or cmd2's print methods.
194
338
  super().__init__(
195
339
  file=file,
196
340
  soft_wrap=True,
@@ -203,23 +347,25 @@ class Cmd2GeneralConsole(Cmd2BaseConsole):
203
347
  class Cmd2RichArgparseConsole(Cmd2BaseConsole):
204
348
  """Rich console for rich-argparse output.
205
349
 
206
- This class ensures long lines in help text are not truncated by avoiding soft_wrap,
350
+ Ensures long lines in help text are not truncated by disabling soft_wrap,
207
351
  which conflicts with rich-argparse's explicit no_wrap and overflow settings.
352
+
353
+ Since this console is used to print error messages which may not be intended
354
+ for Rich formatting, it disables Rich's automatic detection for markup, emoji,
355
+ and highlighting. Because rich-argparse does markup and highlighting without
356
+ involving the console, disabling these settings does not affect the library's
357
+ internal functionality.
208
358
  """
209
359
 
210
- def __init__(self, file: IO[str] | None = None) -> None:
360
+ def __init__(self, *, file: IO[str] | None = None) -> None:
211
361
  """Cmd2RichArgparseConsole initializer.
212
362
 
213
363
  :param file: optional file object where the console should write to.
214
364
  Defaults to sys.stdout.
215
365
  """
216
- # Since this console is used to print error messages which may not have
217
- # been pre-formatted by rich-argparse, disable Rich's automatic detection
218
- # for markup, emoji, and highlighting. rich-argparse does markup and
219
- # highlighting without involving the console so these won't affect its
220
- # internal functionality.
221
366
  super().__init__(
222
367
  file=file,
368
+ soft_wrap=False,
223
369
  markup=False,
224
370
  emoji=False,
225
371
  highlight=False,
@@ -227,11 +373,27 @@ class Cmd2RichArgparseConsole(Cmd2BaseConsole):
227
373
 
228
374
 
229
375
  class Cmd2ExceptionConsole(Cmd2BaseConsole):
230
- """Rich console for printing exceptions.
376
+ """Rich console for printing exceptions and Rich Tracebacks.
231
377
 
232
- Ensures that long exception messages word wrap for readability by keeping soft_wrap disabled.
378
+ Ensures that output is always word-wrapped for readability and disables
379
+ Rich's automatic detection for markup, emoji, and highlighting to prevent
380
+ interference with raw error data.
233
381
  """
234
382
 
383
+ def __init__(self, *, file: IO[str] | None = None) -> None:
384
+ """Cmd2ExceptionConsole initializer.
385
+
386
+ :param file: optional file object where the console should write to.
387
+ Defaults to sys.stdout.
388
+ """
389
+ super().__init__(
390
+ file=file,
391
+ soft_wrap=False,
392
+ markup=False,
393
+ emoji=False,
394
+ highlight=False,
395
+ )
396
+
235
397
 
236
398
  def console_width() -> int:
237
399
  """Return the width of the console."""
@@ -252,9 +414,6 @@ def rich_text_to_string(text: Text) -> str:
252
414
  force_terminal=True,
253
415
  soft_wrap=True,
254
416
  no_color=False,
255
- markup=False,
256
- emoji=False,
257
- highlight=False,
258
417
  theme=APP_THEME,
259
418
  )
260
419
  with console.capture() as capture:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmd2
3
- Version: 3.2.2
3
+ Version: 3.4.0
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
@@ -119,6 +119,7 @@ examples/argparse_example.py
119
119
  examples/async_call.py
120
120
  examples/async_printing.py
121
121
  examples/basic_completion.py
122
+ examples/cmd2_history.dat
122
123
  examples/cmd_as_argument.py
123
124
  examples/color.py
124
125
  examples/command_sets.py
Binary file
@@ -6,9 +6,7 @@ import os
6
6
  import signal
7
7
  import sys
8
8
  import tempfile
9
- from code import (
10
- InteractiveConsole,
11
- )
9
+ from code import InteractiveConsole
12
10
  from typing import NoReturn
13
11
  from unittest import mock
14
12
 
@@ -13,6 +13,8 @@ from cmd2 import (
13
13
  )
14
14
  from cmd2 import rich_utils as ru
15
15
 
16
+ from .conftest import with_ansi_style
17
+
16
18
 
17
19
  def test_cmd2_base_console() -> None:
18
20
  # Test the keyword arguments which are not allowed.
@@ -142,3 +144,51 @@ def test_from_ansi_wrapper() -> None:
142
144
  # Test empty string
143
145
  input_string = ""
144
146
  assert Text.from_ansi(input_string).plain == input_string
147
+
148
+
149
+ @with_ansi_style(ru.AllowStyle.ALWAYS)
150
+ def test_cmd2_base_console_print() -> None:
151
+ """Test that Cmd2BaseConsole.print() correctly propagates formatting overrides to structured renderables."""
152
+ from rich.rule import Rule
153
+
154
+ # Create a console that defaults to no formatting
155
+ console = ru.Cmd2BaseConsole(emoji=False, markup=False)
156
+
157
+ # Use a Rule with emoji and markup in the title
158
+ rule = Rule(title="[green]Success :1234:[/green]")
159
+
160
+ with console.capture() as capture:
161
+ # Override settings in the print() call
162
+ console.print(rule, emoji=True, markup=True)
163
+
164
+ result = capture.get()
165
+
166
+ # Verify that the overrides were respected by checking for the emoji and the color code
167
+ assert "🔢" in result
168
+ assert "\x1b[32mSuccess" in result
169
+
170
+
171
+ @with_ansi_style(ru.AllowStyle.ALWAYS)
172
+ def test_cmd2_base_console_log() -> None:
173
+ """Test that Cmd2BaseConsole.log() correctly propagates formatting overrides to structured renderables."""
174
+ from rich.rule import Rule
175
+
176
+ # Create a console that defaults to no formatting
177
+ console = ru.Cmd2BaseConsole(emoji=False, markup=False)
178
+
179
+ # Use a Rule with emoji and markup in the title
180
+ rule = Rule(title="[green]Success :1234:[/green]")
181
+
182
+ with console.capture() as capture:
183
+ # Override settings in the log() call
184
+ console.log(rule, emoji=True, markup=True)
185
+
186
+ result = capture.get()
187
+
188
+ # Verify that the formatting overrides were respected
189
+ assert "🔢" in result
190
+ assert "\x1b[32mSuccess" in result
191
+
192
+ # Verify stack offset: the log line should point to this file, not rich_utils.py
193
+ # Rich logs include the filename and line number on the right.
194
+ assert "test_rich_utils.py" in result
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes