cmd2 4.0.0b1__tar.gz → 4.0.0b3__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 (224) hide show
  1. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/.pre-commit-config.yaml +16 -1
  2. cmd2-4.0.0b3/.typos.toml +5 -0
  3. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/CHANGELOG.md +61 -4
  4. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/Makefile +4 -4
  5. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/PKG-INFO +4 -4
  6. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/README.md +1 -1
  7. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/__init__.py +52 -40
  8. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/argparse_completer.py +156 -127
  9. cmd2-4.0.0b3/cmd2/argparse_utils.py +847 -0
  10. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/cmd2.py +775 -590
  11. cmd2-4.0.0b3/cmd2/command_set.py +137 -0
  12. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/completion.py +60 -35
  13. cmd2-4.0.0b3/cmd2/constants.py +100 -0
  14. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/decorators.py +149 -130
  15. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/history.py +19 -19
  16. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/parsing.py +43 -43
  17. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/pt_utils.py +22 -19
  18. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/py_bridge.py +4 -4
  19. cmd2-4.0.0b3/cmd2/rich_utils.py +756 -0
  20. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/string_utils.py +24 -1
  21. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/styles.py +7 -1
  22. cmd2-4.0.0b3/cmd2/types.py +113 -0
  23. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/utils.py +41 -40
  24. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2.egg-info/PKG-INFO +4 -4
  25. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2.egg-info/SOURCES.txt +7 -7
  26. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2.egg-info/requires.txt +2 -2
  27. cmd2-4.0.0b3/docs/api/argparse_utils.md +3 -0
  28. cmd2-4.0.0b3/docs/api/command_set.md +3 -0
  29. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/index.md +3 -3
  30. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/doc_conventions.md +1 -1
  31. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/argument_processing.md +20 -24
  32. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/completion.md +3 -3
  33. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/generating_output.md +1 -1
  34. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/help.md +56 -30
  35. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/initialization.md +9 -2
  36. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/misc.md +4 -0
  37. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/modular_commands.md +98 -52
  38. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/migrating/next_steps.md +2 -2
  39. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/README.md +5 -6
  40. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/argparse_completion.py +17 -17
  41. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/argparse_example.py +38 -39
  42. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/async_call.py +5 -5
  43. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/async_commands.py +6 -6
  44. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/async_printing.py +15 -15
  45. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/basic_completion.py +7 -7
  46. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/cmd_as_argument.py +22 -22
  47. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/color.py +4 -4
  48. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/command_sets.py +41 -39
  49. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/custom_parser.py +7 -7
  50. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/custom_types.py +10 -10
  51. cmd2-4.0.0b3/examples/default_categories.py +68 -0
  52. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/dynamic_commands.py +3 -3
  53. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/environment.py +5 -5
  54. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/event_loops.py +1 -1
  55. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/exit_code.py +2 -2
  56. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/getting_started.py +14 -19
  57. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/hello_cmd2.py +2 -2
  58. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/help_categories.py +34 -34
  59. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/hooks.py +6 -6
  60. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/migrating.py +6 -6
  61. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/mixin.py +3 -3
  62. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/modular_commands/commandset_basic.py +15 -13
  63. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/modular_commands/commandset_complex.py +17 -15
  64. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/modular_commands/commandset_custominit.py +8 -5
  65. cmd2-4.0.0b1/examples/modular_commands.py → cmd2-4.0.0b3/examples/modular_commandsets.py +6 -6
  66. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/paged_output.py +4 -4
  67. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/persistent_history.py +3 -3
  68. cmd2-4.0.0b3/examples/pretty_print.py +28 -0
  69. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/python_scripting.py +14 -14
  70. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/read_input.py +35 -8
  71. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/remove_builtin_commands.py +2 -2
  72. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/remove_settable.py +2 -2
  73. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/rich_tables.py +13 -18
  74. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/scripts/conditional.py +10 -10
  75. cmd2-4.0.0b3/examples/scripts/save_help_text.py +107 -0
  76. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/unicode_commands.py +2 -2
  77. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/mkdocs.yml +2 -2
  78. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/pyproject.toml +4 -4
  79. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/ruff.toml +2 -5
  80. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/scripts/validate_tag.py +5 -5
  81. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/conftest.py +6 -20
  82. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/echo.py +2 -2
  83. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/environment.py +1 -1
  84. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/help.py +1 -1
  85. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/raises_exception.py +1 -1
  86. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/recursive.py +1 -1
  87. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/self_in_py.py +1 -1
  88. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/stop.py +2 -2
  89. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_argparse.py +182 -152
  90. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_argparse_completer.py +566 -431
  91. cmd2-4.0.0b3/tests/test_argparse_subcommands.py +131 -0
  92. cmd2-4.0.0b3/tests/test_argparse_utils.py +567 -0
  93. cmd2-4.0.0b3/tests/test_categories.py +130 -0
  94. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_cmd2.py +1109 -684
  95. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_commandset.py +291 -276
  96. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_completion.py +276 -259
  97. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_dynamic_complete_style.py +6 -6
  98. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_future_annotations.py +2 -2
  99. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_history.py +263 -263
  100. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_parsing.py +425 -425
  101. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_plugin.py +86 -86
  102. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_pt_utils.py +63 -56
  103. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_py_completion.py +5 -5
  104. cmd2-4.0.0b3/tests/test_rich_utils.py +363 -0
  105. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_run_pyscript.py +44 -44
  106. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_string_utils.py +55 -29
  107. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_utils.py +63 -63
  108. cmd2-4.0.0b1/cmd2/argparse_custom.py +0 -1310
  109. cmd2-4.0.0b1/cmd2/command_definition.py +0 -202
  110. cmd2-4.0.0b1/cmd2/constants.py +0 -53
  111. cmd2-4.0.0b1/cmd2/rich_utils.py +0 -540
  112. cmd2-4.0.0b1/cmd2/types.py +0 -61
  113. cmd2-4.0.0b1/docs/api/argparse_custom.md +0 -3
  114. cmd2-4.0.0b1/docs/api/command_definition.md +0 -3
  115. cmd2-4.0.0b1/examples/cmd2_history.dat +0 -0
  116. cmd2-4.0.0b1/examples/default_categories.py +0 -76
  117. cmd2-4.0.0b1/examples/pretty_print.py +0 -44
  118. cmd2-4.0.0b1/examples/scripts/save_help_text.py +0 -97
  119. cmd2-4.0.0b1/tests/test_argparse_custom.py +0 -355
  120. cmd2-4.0.0b1/tests/test_argparse_subcommands.py +0 -133
  121. cmd2-4.0.0b1/tests/test_categories.py +0 -109
  122. cmd2-4.0.0b1/tests/test_rich_utils.py +0 -194
  123. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/.prettierignore +0 -0
  124. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/.prettierrc +0 -0
  125. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/GEMINI.md +0 -0
  126. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/LICENSE +0 -0
  127. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/MANIFEST.in +0 -0
  128. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/clipboard.py +0 -0
  129. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/colors.py +0 -0
  130. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/exceptions.py +0 -0
  131. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/plugin.py +0 -0
  132. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2/py.typed +0 -0
  133. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2.egg-info/dependency_links.txt +0 -0
  134. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2.egg-info/top_level.txt +0 -0
  135. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/cmd2.png +0 -0
  136. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/codecov.yml +0 -0
  137. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/argparse_completer.md +0 -0
  138. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/clipboard.md +0 -0
  139. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/cmd.md +0 -0
  140. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/colors.md +0 -0
  141. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/completion.md +0 -0
  142. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/constants.md +0 -0
  143. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/decorators.md +0 -0
  144. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/exceptions.md +0 -0
  145. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/history.md +0 -0
  146. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/parsing.md +0 -0
  147. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/plugin.md +0 -0
  148. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/pt_utils.md +0 -0
  149. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/py_bridge.md +0 -0
  150. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/rich_utils.md +0 -0
  151. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/string_utils.md +0 -0
  152. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/styles.md +0 -0
  153. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/api/utils.md +0 -0
  154. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/examples/alternate_event_loops.md +0 -0
  155. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/examples/examples.md +0 -0
  156. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/examples/getting_started.md +0 -0
  157. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/examples/index.md +0 -0
  158. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/async_commands.md +0 -0
  159. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/builtin_commands.md +0 -0
  160. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/clipboard.md +0 -0
  161. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/commands.md +0 -0
  162. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/disable_commands.md +0 -0
  163. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/embedded_python_shells.md +0 -0
  164. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/history.md +0 -0
  165. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/hooks.md +0 -0
  166. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/index.md +0 -0
  167. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/multiline_commands.md +0 -0
  168. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/os.md +0 -0
  169. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/packaging.md +0 -0
  170. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/plugins.md +0 -0
  171. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/prompt.md +0 -0
  172. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/redirection.md +0 -0
  173. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/scripting.md +0 -0
  174. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/settings.md +0 -0
  175. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/shortcuts_aliases_macros.md +0 -0
  176. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/startup_commands.md +0 -0
  177. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/table_creation.md +0 -0
  178. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/features/theme.md +0 -0
  179. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/index.md +0 -0
  180. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/javascripts/readthedocs.js +0 -0
  181. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/migrating/incompatibilities.md +0 -0
  182. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/migrating/index.md +0 -0
  183. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/migrating/minimum.md +0 -0
  184. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/migrating/why.md +0 -0
  185. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/mixins/index.md +0 -0
  186. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/mixins/mixin_template.md +0 -0
  187. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/overrides/main.html +0 -0
  188. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/overview/alternatives.md +0 -0
  189. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/overview/index.md +0 -0
  190. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/overview/installation.md +0 -0
  191. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/overview/integrating.md +0 -0
  192. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/overview/resources.md +0 -0
  193. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/stylesheets/cmd2.css +0 -0
  194. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/testing.md +0 -0
  195. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/docs/upgrades.md +0 -0
  196. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/.cmd2rc +0 -0
  197. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/modular_commands/__init__.py +0 -0
  198. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/rich_theme.py +0 -0
  199. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/scripts/arg_printer.py +0 -0
  200. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/scripts/nested.txt +0 -0
  201. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/scripts/quit.txt +0 -0
  202. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/scripts/script.py +0 -0
  203. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/scripts/script.txt +0 -0
  204. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/tmux_launch.sh +0 -0
  205. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/examples/tmux_split.sh +0 -0
  206. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/package.json +0 -0
  207. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/setup.cfg +0 -0
  208. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/.cmd2rc +0 -0
  209. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/__init__.py +0 -0
  210. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/py_locals.py +0 -0
  211. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/pyscript_dir.py +0 -0
  212. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/pyscript/stdout_capture.py +0 -0
  213. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/relative_multiple.txt +0 -0
  214. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/script.py +0 -0
  215. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/script.txt +0 -0
  216. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/scripts/binary.bin +0 -0
  217. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/scripts/empty.txt +0 -0
  218. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/scripts/help.txt +0 -0
  219. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/scripts/nested.txt +0 -0
  220. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/scripts/one_down.txt +0 -0
  221. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/scripts/postcmds.txt +0 -0
  222. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/scripts/precmds.txt +0 -0
  223. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/scripts/utf8.txt +0 -0
  224. {cmd2-4.0.0b1 → cmd2-4.0.0b3}/tests/test_utils_defining_class.py +0 -0
@@ -3,13 +3,18 @@ repos:
3
3
  rev: "v6.0.0"
4
4
  hooks:
5
5
  - id: check-case-conflict
6
+ - id: check-executables-have-shebangs
6
7
  - id: check-merge-conflict
7
8
  - id: check-toml
9
+ - id: check-yaml
10
+ - id: detect-private-key
8
11
  - id: end-of-file-fixer
12
+ - id: fix-byte-order-marker
13
+ - id: mixed-line-ending
9
14
  - id: trailing-whitespace
10
15
 
11
16
  - repo: https://github.com/astral-sh/ruff-pre-commit
12
- rev: "v0.15.4"
17
+ rev: "v0.15.8"
13
18
  hooks:
14
19
  - id: ruff-format
15
20
  args: [--config=ruff.toml]
@@ -23,3 +28,13 @@ repos:
23
28
  additional_dependencies:
24
29
  - prettier@3.8.1
25
30
  - prettier-plugin-toml@2.0.6
31
+
32
+ - repo: https://github.com/crate-ci/typos
33
+ rev: v1.44.0
34
+ hooks:
35
+ - id: typos
36
+ exclude: |
37
+ (?x)^(
38
+ ruff.toml|
39
+ tests/.*
40
+ )$
@@ -0,0 +1,5 @@
1
+ [default.extend-words]
2
+ EXPLIoT = "EXPLIoT"
3
+ Counterfit = "Counterfit"
4
+ expliot = "expliot"
5
+ counterfit = "counterfit"
@@ -37,13 +37,15 @@ prompt is displayed.
37
37
  longer needed
38
38
  - `completer` functions must now return a `cmd2.Completions` object instead of `list[str]`.
39
39
  - `choices_provider` functions must now return a `cmd2.Choices` object instead of `list[str]`.
40
- - An argparse argument's `descriptive_headers` field is now called `table_header`.
41
- - `CompletionItem.descriptive_data` is now called `CompletionItem.table_row`.
40
+ - An argparse argument's `descriptive_headers` field is now called `table_columns`.
41
+ - `CompletionItem.descriptive_data` is now called `CompletionItem.table_data`.
42
+ - Removed `DEFAULT_DESCRIPTIVE_HEADERS`. This means you must define `table_columns` when using
43
+ `CompletionItem.table_data` data.
42
44
  - `Cmd.default_sort_key` moved to `utils.DEFAULT_STR_SORT_KEY`.
43
45
  - Moved completion state data, which previously resided in `Cmd`, into other classes.
44
46
  - `Cmd.matches_sorted` -> `Completions.is_sorted` and `Choices.is_sorted`
45
- - `Cmd.completion_hint` -> `Completions.completion_hint`
46
- - `Cmd.formatted_completions` -> `Completions.completion_table`
47
+ - `Cmd.completion_hint` -> `Completions.hint`
48
+ - `Cmd.formatted_completions` -> `Completions.table` (Now a Rich Table)
47
49
  - `Cmd.allow_appended_space/allow_closing_quote` -> `Completions.allow_finalization`
48
50
  - Removed `Cmd.matches_delimited` since it's no longer used.
49
51
  - Removed `flag_based_complete` and `index_based_complete` functions since their functionality
@@ -61,6 +63,39 @@ prompt is displayed.
61
63
  `add_alert()`. This new function is thread-safe and does not require you to acquire a mutex
62
64
  before calling it like the previous functions did.
63
65
  - Removed `Cmd.default_to_shell`.
66
+ - Removed `Cmd.ruler` since `cmd2` no longer uses it.
67
+ - All parsers used with `cmd2` commands must be an instance of `Cmd2ArgumentParser` or a child
68
+ class of it.
69
+ - Removed `set_ap_completer_type()` and `get_ap_completer_type()` since `ap_completer_type` is
70
+ now a public member of `Cmd2ArgumentParser`.
71
+ - Moved `set_parser_prog()` to `Cmd2ArgumentParser.update_prog()`.
72
+ - Renamed `cmd2_handler` to `cmd2_subcmd_handler` in the `argparse.Namespace` for clarity.
73
+ - Removed `Cmd2AttributeWrapper` class. `argparse.Namespace` objects passed to command functions
74
+ now contain direct attributes for `cmd2_statement` and `cmd2_subcmd_handler`.
75
+ - Renamed `cmd2/command_definition.py` to `cmd2/command_set.py`.
76
+ - Removed `Cmd.doc_header` and the `with_default_category` decorator. Help categorization is now
77
+ driven by the `DEFAULT_CATEGORY` class variable (see **Simplified command categorization** in
78
+ the Enhancements section below for details).
79
+ - Removed `Cmd.undoc_header` since all commands are now considered categorized.
80
+ - Renamed `Cmd.cmd_func()` to `Cmd.get_command_func()`.
81
+ - `cmd2` no longer sets a default title for a subparsers group. If you desire a title, you will
82
+ need to pass one in like this `parser.add_subparsers(title="subcommands")`. This is standard
83
+ `argparse` behavior.
84
+ - `TextGroup` is now a standalone Rich renderable.
85
+ - Removed `formatter_creator` parameter from `TextGroup.__init__()`.
86
+ - Removed `Cmd2ArgumentParser.create_text_group()` method.
87
+ - `argparse` and `Rich` integration refactoring:
88
+ - Renamed `argparse_custom` module to `argparse_utils`.
89
+ - Moved the following classes from `argparse_utils` to `rich_utils`:
90
+ - `Cmd2HelpFormatter`
91
+ - `ArgumentDefaultsCmd2HelpFormatter`
92
+ - `MetavarTypeCmd2HelpFormatter`
93
+ - `RawDescriptionCmd2HelpFormatter`
94
+ - `RawTextCmd2HelpFormatter`
95
+ - `TextGroup`
96
+ - Replaced the global `APP_THEME` constant in `rich_utils.py` with `get_theme()` and
97
+ `set_theme()` functions to support lazy initialization and safer in-place updates of the
98
+ theme.
64
99
  - Enhancements
65
100
  - New `cmd2.Cmd` parameters
66
101
  - **auto_suggest**: (boolean) if `True`, provide fish shell style auto-suggestions. These
@@ -75,9 +110,31 @@ prompt is displayed.
75
110
  - **get_rprompt**: override to populate right prompt
76
111
  - **pre_prompt**: hook method that is called before the prompt is displayed, but after
77
112
  `prompt-toolkit` event loop has started
113
+ - **read_secret**: read secrets like passwords without displaying them to the terminal
114
+ - **ppretty**: a cmd2-compatible replacement for `rich.pretty.pprint()`
78
115
  - New settables:
79
116
  - **max_column_completion_results**: (int) the maximum number of completion results to
80
117
  display in a single column
118
+ - `cmd2.Cmd.select` has been revamped to use the
119
+ [choice](https://python-prompt-toolkit.readthedocs.io/en/3.0.52/pages/asking_for_a_choice.html)
120
+ function from `prompt-toolkit` when both **stdin** and **stdout** are TTYs
121
+ - Add support for Python 3.15 by fixing various bugs related to internal `argparse` changes
122
+ - Added `common_prefix` method to `cmd2.string_utils` module as a replacement for
123
+ `os.path.commonprefix` since that is now deprecated in Python 3.15
124
+ - Simplified command categorization:
125
+ - By default, all commands in a class are grouped under its `DEFAULT_CATEGORY`.
126
+ - Individual commands can still be manually moved using the `with_category()` decorator.
127
+ - For more details and examples, see the [Help](docs/features/help.md) documentation and the
128
+ `examples/default_categories.py` file.
129
+ - `CommandSet` is now a generic class, which allows developers to parameterize it with their
130
+ specific `cmd2.Cmd` subclass (e.g.,`class MyCommandSet(CommandSet[MyApp]):`). This provides
131
+ full type hints and IDE autocompletion for `self._cmd` without needing to override and cast
132
+ the property.
133
+
134
+ ## 3.5.0 (April 13, 2026)
135
+
136
+ - Bug Fixes
137
+ - Fixed issue where Rich stripped colors from text in test environments where TERM=dumb.
81
138
 
82
139
  ## 3.4.0 (March 3, 2026)
83
140
 
@@ -7,8 +7,8 @@ install: ## Install the virtual environment with dependencies
7
7
  @echo "🚀 Creating uv Python virtual environment"
8
8
  @uv python install 3.14
9
9
  @uv sync --python=3.14
10
- @echo "🚀 Installing Git pre-commit hooks locally"
11
- @uv run pre-commit install
10
+ @echo "🚀 Installing Git prek hooks locally"
11
+ @uv run prek install -f
12
12
  @echo "🚀 Installing Prettier using npm"
13
13
  @npm install -q --no-fund --include=dev
14
14
 
@@ -16,8 +16,8 @@ install: ## Install the virtual environment with dependencies
16
16
  check: ## Run code quality tools.
17
17
  @echo "🚀 Checking lock file consistency with 'pyproject.toml'"
18
18
  @uv lock --locked
19
- @echo "🚀 Linting code and documentation: Running pre-commit"
20
- @uv run pre-commit run -a
19
+ @echo "🚀 Auto-formatting/Linting code and documentation: Running prek"
20
+ @uv run prek run -a
21
21
  @echo "🚀 Static type checking: Running mypy"
22
22
  @uv run mypy
23
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmd2
3
- Version: 4.0.0b1
3
+ Version: 4.0.0b3
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
@@ -25,8 +25,8 @@ License-File: LICENSE
25
25
  Requires-Dist: backports.strenum; python_version == "3.10"
26
26
  Requires-Dist: prompt-toolkit>=3.0.52
27
27
  Requires-Dist: pyperclip>=1.8.2
28
- Requires-Dist: rich>=14.3.0
29
- Requires-Dist: rich-argparse>=1.7.1
28
+ Requires-Dist: rich>=15.0.0
29
+ Requires-Dist: rich-argparse>=1.7.2
30
30
  Requires-Dist: typing-extensions; python_version == "3.10"
31
31
  Dynamic: license-file
32
32
 
@@ -139,7 +139,7 @@ examples.
139
139
  - [cmd2 example applications](https://github.com/python-cmd2/cmd2/tree/main/examples)
140
140
  - Basic cmd2 examples to demonstrate how to use various features
141
141
  - [Advanced Examples](https://github.com/jayrod/cmd2-example-apps)
142
- - More complex examples that demonstrate more featuers about how to put together a complete
142
+ - More complex examples that demonstrate more features about how to put together a complete
143
143
  application
144
144
  - [Cookiecutter](https://github.com/cookiecutter/cookiecutter) Templates from community
145
145
  - Basic cookiecutter template for cmd2 application :
@@ -107,7 +107,7 @@ examples.
107
107
  - [cmd2 example applications](https://github.com/python-cmd2/cmd2/tree/main/examples)
108
108
  - Basic cmd2 examples to demonstrate how to use various features
109
109
  - [Advanced Examples](https://github.com/jayrod/cmd2-example-apps)
110
- - More complex examples that demonstrate more featuers about how to put together a complete
110
+ - More complex examples that demonstrate more features about how to put together a complete
111
111
  application
112
112
  - [Cookiecutter](https://github.com/cookiecutter/cookiecutter) Templates from community
113
113
  - Basic cookiecutter template for cmd2 application :
@@ -12,18 +12,14 @@ from . import (
12
12
  string_utils,
13
13
  )
14
14
  from .argparse_completer import set_default_ap_completer_type
15
- from .argparse_custom import (
15
+ from .argparse_utils import (
16
16
  Cmd2ArgumentParser,
17
- Cmd2AttributeWrapper,
18
17
  register_argparse_argument_parameter,
19
18
  set_default_argument_parser_type,
20
19
  )
21
20
  from .cmd2 import Cmd
22
21
  from .colors import Color
23
- from .command_definition import (
24
- CommandSet,
25
- with_default_category,
26
- )
22
+ from .command_set import CommandSet
27
23
  from .completion import (
28
24
  Choices,
29
25
  CompletionItem,
@@ -48,7 +44,17 @@ from .exceptions import (
48
44
  )
49
45
  from .parsing import Statement
50
46
  from .py_bridge import CommandResult
51
- from .rich_utils import RichPrintKwargs
47
+ from .rich_utils import (
48
+ ArgumentDefaultsCmd2HelpFormatter,
49
+ Cmd2HelpFormatter,
50
+ MetavarTypeCmd2HelpFormatter,
51
+ RawDescriptionCmd2HelpFormatter,
52
+ RawTextCmd2HelpFormatter,
53
+ RichPrintKwargs,
54
+ TextGroup,
55
+ get_theme,
56
+ set_theme,
57
+ )
52
58
  from .string_utils import stylize
53
59
  from .styles import Cmd2Style
54
60
  from .utils import (
@@ -59,50 +65,56 @@ from .utils import (
59
65
  )
60
66
 
61
67
  __all__: list[str] = [ # noqa: RUF022
62
- 'COMMAND_NAME',
63
- 'DEFAULT_SHORTCUTS',
68
+ "COMMAND_NAME",
69
+ "DEFAULT_SHORTCUTS",
64
70
  # Argparse Exports
65
- 'Cmd2ArgumentParser',
66
- 'Cmd2AttributeWrapper',
67
- 'register_argparse_argument_parameter',
68
- 'set_default_ap_completer_type',
69
- 'set_default_argument_parser_type',
71
+ "Cmd2ArgumentParser",
72
+ "register_argparse_argument_parameter",
73
+ "set_default_ap_completer_type",
74
+ "set_default_argument_parser_type",
70
75
  # Cmd2
71
- 'Cmd',
72
- 'CommandResult',
73
- 'CommandSet',
74
- 'Statement',
76
+ "Cmd",
77
+ "CommandResult",
78
+ "CommandSet",
79
+ "Statement",
75
80
  # Colors
76
81
  "Color",
77
82
  # Completion
78
- 'Choices',
79
- 'CompletionItem',
80
- 'Completions',
83
+ "Choices",
84
+ "CompletionItem",
85
+ "Completions",
81
86
  # Decorators
82
- 'with_argument_list',
83
- 'with_argparser',
84
- 'with_category',
85
- 'with_default_category',
86
- 'as_subcommand_to',
87
+ "with_argument_list",
88
+ "with_argparser",
89
+ "with_category",
90
+ "as_subcommand_to",
87
91
  # Exceptions
88
- 'Cmd2ArgparseError',
89
- 'CommandSetRegistrationError',
90
- 'CompletionError',
91
- 'PassThroughException',
92
- 'SkipPostcommandHooks',
92
+ "Cmd2ArgparseError",
93
+ "CommandSetRegistrationError",
94
+ "CompletionError",
95
+ "PassThroughException",
96
+ "SkipPostcommandHooks",
93
97
  # modules
94
- 'plugin',
95
- 'rich_utils',
96
- 'string_utils',
98
+ "plugin",
99
+ "rich_utils",
100
+ "string_utils",
97
101
  # Rich Utils
98
- 'RichPrintKwargs',
102
+ "ArgumentDefaultsCmd2HelpFormatter",
103
+ "Cmd2HelpFormatter",
104
+ "get_theme",
105
+ "MetavarTypeCmd2HelpFormatter",
106
+ "RawDescriptionCmd2HelpFormatter",
107
+ "RawTextCmd2HelpFormatter",
108
+ "RichPrintKwargs",
109
+ "set_theme",
110
+ "TextGroup",
99
111
  # String Utils
100
- 'stylize',
112
+ "stylize",
101
113
  # Styles,
102
114
  "Cmd2Style",
103
115
  # Utilities
104
- 'categorize',
105
- 'CustomCompletionSettings',
106
- 'Settable',
107
- 'set_default_str_sort_key',
116
+ "categorize",
117
+ "CustomCompletionSettings",
118
+ "Settable",
119
+ "set_default_str_sort_key",
108
120
  ]