cmd2 3.4.0__tar.gz → 4.0.0b2__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 (245) hide show
  1. {cmd2-3.4.0 → cmd2-4.0.0b2}/.pre-commit-config.yaml +16 -1
  2. cmd2-4.0.0b2/.typos.toml +5 -0
  3. {cmd2-3.4.0 → cmd2-4.0.0b2}/CHANGELOG.md +91 -0
  4. {cmd2-3.4.0 → cmd2-4.0.0b2}/Makefile +7 -5
  5. {cmd2-3.4.0 → cmd2-4.0.0b2}/PKG-INFO +4 -7
  6. {cmd2-3.4.0 → cmd2-4.0.0b2}/README.md +2 -4
  7. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/__init__.py +12 -5
  8. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/argparse_completer.py +377 -320
  9. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/argparse_custom.py +149 -245
  10. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/cmd2.py +1340 -1681
  11. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/command_definition.py +12 -12
  12. cmd2-4.0.0b2/cmd2/completion.py +256 -0
  13. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/constants.py +4 -5
  14. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/decorators.py +48 -53
  15. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/exceptions.py +10 -6
  16. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/history.py +10 -12
  17. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/parsing.py +177 -150
  18. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/plugin.py +2 -6
  19. cmd2-4.0.0b2/cmd2/pt_utils.py +308 -0
  20. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/py_bridge.py +3 -5
  21. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/rich_utils.py +103 -101
  22. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/string_utils.py +23 -0
  23. cmd2-4.0.0b2/cmd2/types.py +61 -0
  24. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/utils.py +48 -52
  25. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2.egg-info/PKG-INFO +4 -7
  26. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2.egg-info/SOURCES.txt +13 -33
  27. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2.egg-info/requires.txt +1 -6
  28. cmd2-4.0.0b2/docs/api/completion.md +3 -0
  29. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/index.md +2 -4
  30. cmd2-4.0.0b2/docs/api/pt_utils.md +3 -0
  31. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/doc_conventions.md +1 -1
  32. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/examples/alternate_event_loops.md +9 -1
  33. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/examples/getting_started.md +12 -6
  34. cmd2-4.0.0b2/docs/features/async_commands.md +74 -0
  35. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/builtin_commands.md +13 -13
  36. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/completion.md +2 -15
  37. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/generating_output.md +1 -2
  38. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/history.md +21 -32
  39. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/hooks.md +3 -1
  40. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/index.md +1 -1
  41. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/initialization.md +3 -3
  42. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/misc.md +4 -20
  43. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/os.md +8 -8
  44. cmd2-4.0.0b2/docs/features/prompt.md +99 -0
  45. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/settings.md +6 -6
  46. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/startup_commands.md +1 -1
  47. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/migrating/incompatibilities.md +3 -3
  48. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/migrating/why.md +6 -7
  49. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/overview/alternatives.md +7 -11
  50. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/overview/installation.md +0 -33
  51. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/overview/integrating.md +0 -13
  52. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/upgrades.md +50 -0
  53. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/README.md +6 -6
  54. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/argparse_completion.py +19 -16
  55. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/async_call.py +13 -17
  56. cmd2-4.0.0b2/examples/async_commands.py +143 -0
  57. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/async_printing.py +32 -50
  58. cmd2-4.0.0b2/examples/basic_completion.py +56 -0
  59. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/cmd_as_argument.py +1 -6
  60. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/command_sets.py +3 -3
  61. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/custom_types.py +1 -1
  62. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/getting_started.py +37 -0
  63. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/hello_cmd2.py +5 -2
  64. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/hooks.py +0 -2
  65. cmd2-4.0.0b2/examples/modular_commands/commandset_basic.py +45 -0
  66. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/read_input.py +32 -18
  67. {cmd2-3.4.0 → cmd2-4.0.0b2}/mkdocs.yml +4 -4
  68. {cmd2-3.4.0 → cmd2-4.0.0b2}/pyproject.toml +7 -8
  69. {cmd2-3.4.0 → cmd2-4.0.0b2}/ruff.toml +1 -1
  70. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/conftest.py +0 -36
  71. cmd2-4.0.0b2/tests/scripts/postcmds.txt +1 -0
  72. cmd2-4.0.0b2/tests/scripts/precmds.txt +1 -0
  73. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_argparse_completer.py +457 -387
  74. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_argparse_custom.py +79 -18
  75. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_cmd2.py +1375 -362
  76. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_commandset.py +34 -47
  77. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_completion.py +375 -614
  78. cmd2-4.0.0b2/tests/test_dynamic_complete_style.py +75 -0
  79. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_history.py +48 -53
  80. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_parsing.py +131 -201
  81. cmd2-4.0.0b2/tests/test_pt_utils.py +626 -0
  82. cmd2-4.0.0b2/tests/test_py_completion.py +54 -0
  83. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_rich_utils.py +37 -38
  84. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_run_pyscript.py +8 -8
  85. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_string_utils.py +26 -0
  86. cmd2-3.4.0/cmd2/rl_utils.py +0 -301
  87. cmd2-3.4.0/cmd2/terminal_utils.py +0 -144
  88. cmd2-3.4.0/cmd2/transcript.py +0 -225
  89. cmd2-3.4.0/docs/api/rl_utils.md +0 -3
  90. cmd2-3.4.0/docs/api/terminal_utils.md +0 -3
  91. cmd2-3.4.0/docs/api/transcript.md +0 -3
  92. cmd2-3.4.0/docs/features/prompt.md +0 -50
  93. cmd2-3.4.0/docs/features/transcripts.md +0 -182
  94. cmd2-3.4.0/examples/basic_completion.py +0 -99
  95. cmd2-3.4.0/examples/cmd2_history.dat +0 -0
  96. cmd2-3.4.0/examples/modular_commands/commandset_basic.py +0 -87
  97. cmd2-3.4.0/examples/transcript_example.py +0 -84
  98. cmd2-3.4.0/examples/transcripts/exampleSession.txt +0 -14
  99. cmd2-3.4.0/examples/transcripts/pirate.transcript +0 -10
  100. cmd2-3.4.0/examples/transcripts/quit.txt +0 -1
  101. cmd2-3.4.0/examples/transcripts/transcript_regex.txt +0 -15
  102. cmd2-3.4.0/tests/scripts/postcmds.txt +0 -1
  103. cmd2-3.4.0/tests/scripts/precmds.txt +0 -1
  104. cmd2-3.4.0/tests/test_async_alert.py +0 -50
  105. cmd2-3.4.0/tests/test_terminal_utils.py +0 -81
  106. cmd2-3.4.0/tests/test_transcript.py +0 -328
  107. cmd2-3.4.0/tests/transcripts/bol_eol.txt +0 -6
  108. cmd2-3.4.0/tests/transcripts/characterclass.txt +0 -6
  109. cmd2-3.4.0/tests/transcripts/dotstar.txt +0 -4
  110. cmd2-3.4.0/tests/transcripts/extension_notation.txt +0 -4
  111. cmd2-3.4.0/tests/transcripts/failure.txt +0 -4
  112. cmd2-3.4.0/tests/transcripts/from_cmdloop.txt +0 -44
  113. cmd2-3.4.0/tests/transcripts/multiline_no_regex.txt +0 -6
  114. cmd2-3.4.0/tests/transcripts/multiline_regex.txt +0 -6
  115. cmd2-3.4.0/tests/transcripts/no_output.txt +0 -7
  116. cmd2-3.4.0/tests/transcripts/no_output_last.txt +0 -7
  117. cmd2-3.4.0/tests/transcripts/singleslash.txt +0 -5
  118. cmd2-3.4.0/tests/transcripts/slashes_escaped.txt +0 -6
  119. cmd2-3.4.0/tests/transcripts/slashslash.txt +0 -4
  120. cmd2-3.4.0/tests/transcripts/spaces.txt +0 -8
  121. cmd2-3.4.0/tests/transcripts/word_boundaries.txt +0 -6
  122. {cmd2-3.4.0 → cmd2-4.0.0b2}/.prettierignore +0 -0
  123. {cmd2-3.4.0 → cmd2-4.0.0b2}/.prettierrc +0 -0
  124. {cmd2-3.4.0 → cmd2-4.0.0b2}/GEMINI.md +0 -0
  125. {cmd2-3.4.0 → cmd2-4.0.0b2}/LICENSE +0 -0
  126. {cmd2-3.4.0 → cmd2-4.0.0b2}/MANIFEST.in +0 -0
  127. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/clipboard.py +0 -0
  128. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/colors.py +0 -0
  129. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/py.typed +0 -0
  130. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2/styles.py +0 -0
  131. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2.egg-info/dependency_links.txt +0 -0
  132. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2.egg-info/top_level.txt +0 -0
  133. {cmd2-3.4.0 → cmd2-4.0.0b2}/cmd2.png +0 -0
  134. {cmd2-3.4.0 → cmd2-4.0.0b2}/codecov.yml +0 -0
  135. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/argparse_completer.md +0 -0
  136. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/argparse_custom.md +0 -0
  137. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/clipboard.md +0 -0
  138. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/cmd.md +0 -0
  139. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/colors.md +0 -0
  140. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/command_definition.md +0 -0
  141. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/constants.md +0 -0
  142. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/decorators.md +0 -0
  143. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/exceptions.md +0 -0
  144. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/history.md +0 -0
  145. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/parsing.md +0 -0
  146. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/plugin.md +0 -0
  147. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/py_bridge.md +0 -0
  148. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/rich_utils.md +0 -0
  149. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/string_utils.md +0 -0
  150. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/styles.md +0 -0
  151. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/api/utils.md +0 -0
  152. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/examples/examples.md +0 -0
  153. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/examples/index.md +0 -0
  154. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/argument_processing.md +0 -0
  155. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/clipboard.md +0 -0
  156. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/commands.md +0 -0
  157. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/disable_commands.md +0 -0
  158. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/embedded_python_shells.md +0 -0
  159. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/help.md +0 -0
  160. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/modular_commands.md +0 -0
  161. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/multiline_commands.md +0 -0
  162. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/packaging.md +0 -0
  163. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/plugins.md +0 -0
  164. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/redirection.md +0 -0
  165. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/scripting.md +0 -0
  166. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/shortcuts_aliases_macros.md +0 -0
  167. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/table_creation.md +0 -0
  168. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/features/theme.md +0 -0
  169. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/index.md +0 -0
  170. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/javascripts/readthedocs.js +0 -0
  171. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/migrating/index.md +0 -0
  172. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/migrating/minimum.md +0 -0
  173. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/migrating/next_steps.md +0 -0
  174. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/mixins/index.md +0 -0
  175. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/mixins/mixin_template.md +0 -0
  176. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/overrides/main.html +0 -0
  177. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/overview/index.md +0 -0
  178. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/overview/resources.md +0 -0
  179. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/stylesheets/cmd2.css +0 -0
  180. {cmd2-3.4.0 → cmd2-4.0.0b2}/docs/testing.md +0 -0
  181. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/.cmd2rc +0 -0
  182. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/argparse_example.py +0 -0
  183. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/color.py +0 -0
  184. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/custom_parser.py +0 -0
  185. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/default_categories.py +0 -0
  186. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/dynamic_commands.py +0 -0
  187. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/environment.py +0 -0
  188. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/event_loops.py +0 -0
  189. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/exit_code.py +0 -0
  190. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/help_categories.py +0 -0
  191. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/migrating.py +0 -0
  192. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/mixin.py +0 -0
  193. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/modular_commands/__init__.py +0 -0
  194. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/modular_commands/commandset_complex.py +0 -0
  195. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/modular_commands/commandset_custominit.py +0 -0
  196. /cmd2-3.4.0/examples/modular_commands.py → /cmd2-4.0.0b2/examples/modular_commandsets.py +0 -0
  197. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/paged_output.py +0 -0
  198. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/persistent_history.py +0 -0
  199. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/pretty_print.py +0 -0
  200. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/python_scripting.py +0 -0
  201. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/remove_builtin_commands.py +0 -0
  202. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/remove_settable.py +0 -0
  203. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/rich_tables.py +0 -0
  204. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/rich_theme.py +0 -0
  205. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/scripts/arg_printer.py +0 -0
  206. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/scripts/conditional.py +0 -0
  207. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/scripts/nested.txt +0 -0
  208. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/scripts/quit.txt +0 -0
  209. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/scripts/save_help_text.py +0 -0
  210. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/scripts/script.py +0 -0
  211. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/scripts/script.txt +0 -0
  212. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/tmux_launch.sh +0 -0
  213. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/tmux_split.sh +0 -0
  214. {cmd2-3.4.0 → cmd2-4.0.0b2}/examples/unicode_commands.py +0 -0
  215. {cmd2-3.4.0 → cmd2-4.0.0b2}/package.json +0 -0
  216. {cmd2-3.4.0 → cmd2-4.0.0b2}/scripts/validate_tag.py +0 -0
  217. {cmd2-3.4.0 → cmd2-4.0.0b2}/setup.cfg +0 -0
  218. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/.cmd2rc +0 -0
  219. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/__init__.py +0 -0
  220. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/echo.py +0 -0
  221. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/environment.py +0 -0
  222. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/help.py +0 -0
  223. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/py_locals.py +0 -0
  224. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/pyscript_dir.py +0 -0
  225. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/raises_exception.py +0 -0
  226. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/recursive.py +0 -0
  227. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/self_in_py.py +0 -0
  228. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/stdout_capture.py +0 -0
  229. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/pyscript/stop.py +0 -0
  230. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/relative_multiple.txt +0 -0
  231. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/script.py +0 -0
  232. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/script.txt +0 -0
  233. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/scripts/binary.bin +0 -0
  234. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/scripts/empty.txt +0 -0
  235. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/scripts/help.txt +0 -0
  236. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/scripts/nested.txt +0 -0
  237. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/scripts/one_down.txt +0 -0
  238. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/scripts/utf8.txt +0 -0
  239. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_argparse.py +0 -0
  240. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_argparse_subcommands.py +0 -0
  241. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_categories.py +0 -0
  242. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_future_annotations.py +0 -0
  243. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_plugin.py +0 -0
  244. {cmd2-3.4.0 → cmd2-4.0.0b2}/tests/test_utils.py +0 -0
  245. {cmd2-3.4.0 → cmd2-4.0.0b2}/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.0"
17
+ rev: "v0.15.6"
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"
@@ -1,3 +1,94 @@
1
+ ## 4.0.0 (TBD 2026)
2
+
3
+ ### Summary
4
+
5
+ `cmd2` now has a dependency on
6
+ [prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) which serves as a
7
+ pure-Python cross-platform replacement for
8
+ [GNU Readline](https://tiswww.case.edu/php/chet/readline/rltop.html). Previously, `cmd2` had used
9
+ different `readline` dependencies on each Operating System (OS) which was at times a very
10
+ frustrating developer and user experience due to small inconsistencies in these different readline
11
+ libraries. Now we have consistent cross-platform support for tab-completion, user terminal input,
12
+ and history. Additionally, this opens up some cool advanced features such as support for syntax
13
+ highlighting of user input while typing, auto-suggestions similar to those provided by the fish
14
+ shell, and the option for a persistent bottom bar that can display realtime status updates while the
15
+ prompt is displayed.
16
+
17
+ ### Details
18
+
19
+ - Breaking Changes
20
+ - Removed all use of `readline` built-in module and underlying platform libraries
21
+ - Deleted `cmd2.rl_utils` module which dealt with importing the proper `readline` module for
22
+ each platform and provided utility functions related to `readline`
23
+ - Added a dependency on `prompt-toolkit` and a new `cmd2.pt_utils` module with supporting
24
+ utilities
25
+ - Removed **Transcript Testing** feature set along with the `history -t` option for generating
26
+ transcript files and the `cmd2.transcript` module
27
+ - This was an extremely brittle regression testing framework which should never have been
28
+ built into cmd2
29
+ - We recommend using [pytest](https://docs.pytest.org/) for unit and integration tests and
30
+ [Robot Framework](https://robotframework.org/) for acceptance tests. Both of these
31
+ frameworks can be used to create tests which are far more reliable and less brittle.
32
+ - Async specific: `prompt-toolkit` starts its own `asyncio` event loop in every `cmd2`
33
+ application
34
+ - Removed `cmd2.Cmd.terminal_lock` as it is no longer required to support things like
35
+ `cmd2.Cmd.async_alert`
36
+ - Removed `cmd2.Cmd.async_refresh_prompt` and `cmd2.Cmd.need_prompt_refresh` as they are no
37
+ longer needed
38
+ - `completer` functions must now return a `cmd2.Completions` object instead of `list[str]`.
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_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.
44
+ - `Cmd.default_sort_key` moved to `utils.DEFAULT_STR_SORT_KEY`.
45
+ - Moved completion state data, which previously resided in `Cmd`, into other classes.
46
+ - `Cmd.matches_sorted` -> `Completions.is_sorted` and `Choices.is_sorted`
47
+ - `Cmd.completion_hint` -> `Completions.hint`
48
+ - `Cmd.formatted_completions` -> `Completions.table` (Now a Rich Table)
49
+ - `Cmd.allow_appended_space/allow_closing_quote` -> `Completions.allow_finalization`
50
+ - Removed `Cmd.matches_delimited` since it's no longer used.
51
+ - Removed `flag_based_complete` and `index_based_complete` functions since their functionality
52
+ is already provided in arpgarse-based completion.
53
+ - Changed `Statement.multiline_command` from a string to a bool.
54
+ - Made `Statement.arg_list` a property which generates the list on-demand.
55
+ - Renamed `Statement.output` to `Statement.redirector`.
56
+ - Renamed `Statement.output_to` to `Statement.redirect_to`.
57
+ - Removed `Statement.pipe_to` since it can be handled by `Statement.redirector` and
58
+ `Statement.redirect_to`.
59
+ - Changed `StatementParser.parse_command_only()` to return a `PartialStatement` object.
60
+ - Renamed `Macro.arg_list` to `Macro.args`.
61
+ - Removed `terminal_utils.py` since `prompt-toolkit` provides this functionality.
62
+ - Replaced `async_alert()` and `async_update_prompt()` with a single function called
63
+ `add_alert()`. This new function is thread-safe and does not require you to acquire a mutex
64
+ before calling it like the previous functions did.
65
+ - Removed `Cmd.default_to_shell`.
66
+ - Removed `Cmd.ruler` since `cmd2` no longer uses it.
67
+ - Enhancements
68
+ - New `cmd2.Cmd` parameters
69
+ - **auto_suggest**: (boolean) if `True`, provide fish shell style auto-suggestions. These
70
+ are grayed-out hints based on history. User can press right-arrow key to accept the
71
+ provided suggestion.
72
+ - **bottom toolbar**: (boolean) if `True`, present a persistent bottom toolbar capable of
73
+ displaying realtime status information while the prompt is displayed, see the
74
+ `cmd2.Cmd2.get_bottom_toolbar` method that can be overridden as well as the updated
75
+ `getting_started.py` example
76
+ - New `cmd2.Cmd` methods
77
+ - **get_bottom_toolbar**: populates bottom toolbar if `bottom_toolbar` is `True`
78
+ - **get_rprompt**: override to populate right prompt
79
+ - **pre_prompt**: hook method that is called before the prompt is displayed, but after
80
+ `prompt-toolkit` event loop has started
81
+ - **read_secret**: read secrets like passwords without displaying them to the terminal
82
+ - New settables:
83
+ - **max_column_completion_results**: (int) the maximum number of completion results to
84
+ display in a single column
85
+ - `cmd2.Cmd.select` has been revamped to use the
86
+ [choice](https://python-prompt-toolkit.readthedocs.io/en/3.0.52/pages/asking_for_a_choice.html)
87
+ function from `prompt-toolkit` when both **stdin** and **stdout** are TTYs
88
+ - Add support for Python 3.15 by fixing various bugs related to internal `argparse` changes
89
+ - Added `common_prefix` method to `cmd2.string_utils` module as a replacement for
90
+ `os.path.commonprefix` since that is now deprecated in Python 3.15
91
+
1
92
  ## 3.4.0 (March 3, 2026)
2
93
 
3
94
  - Enhancements
@@ -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
 
@@ -77,7 +77,8 @@ publish: validate-tag build ## Publish a release to PyPI, uses token from ~/.pyp
77
77
  BUILD_DIRS = build dist *.egg-info
78
78
  DOC_DIRS = build
79
79
  MYPY_DIRS = .mypy_cache dmypy.json dmypy.sock
80
- TEST_DIRS = .cache .coverage .pytest_cache htmlcov
80
+ TEST_DIRS = .cache .pytest_cache htmlcov
81
+ TEST_FILES = .coverage coverage.xml
81
82
 
82
83
  .PHONY: clean-build
83
84
  clean-build: ## Clean build artifacts
@@ -108,6 +109,7 @@ clean-ruff: ## Clean ruff artifacts
108
109
  clean-test: ## Clean test artifacts
109
110
  @echo "🚀 Removing test artifacts"
110
111
  @uv run python -c "import shutil; import os; [shutil.rmtree(d, ignore_errors=True) for d in '$(TEST_DIRS)'.split() if os.path.isdir(d)]"
112
+ @uv run python -c "from pathlib import Path; [Path(f).unlink(missing_ok=True) for f in '$(TEST_FILES)'.split()]"
111
113
 
112
114
  .PHONY: clean
113
115
  clean: clean-build clean-docs clean-mypy clean-pycache clean-ruff clean-test ## Clean all artifacts
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cmd2
3
- Version: 3.4.0
3
+ Version: 4.0.0b2
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
@@ -23,9 +23,8 @@ Requires-Python: >=3.10
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  Requires-Dist: backports.strenum; python_version == "3.10"
26
- Requires-Dist: gnureadline>=8; platform_system == "Darwin"
26
+ Requires-Dist: prompt-toolkit>=3.0.52
27
27
  Requires-Dist: pyperclip>=1.8.2
28
- Requires-Dist: pyreadline3>=3.4; platform_system == "Windows"
29
28
  Requires-Dist: rich>=14.3.0
30
29
  Requires-Dist: rich-argparse>=1.7.1
31
30
  Requires-Dist: typing-extensions; python_version == "3.10"
@@ -58,7 +57,7 @@ applications. It provides a simple API which is an extension of Python's built-i
58
57
  of cmd to make your life easier and eliminates much of the boilerplate code which would be necessary
59
58
  when using cmd.
60
59
 
61
- > :warning: **`cmd2` 3.0.0 has been released and there are some significant backwards
60
+ > :warning: **`cmd2` `3.x` has been released and there are some significant backwards
62
61
  > incompatibilities from version `2.x`. Please see the
63
62
  > [Migration Guide](https://cmd2.readthedocs.io/en/latest/upgrades/) for tips on upgrading from
64
63
  > `cmd2` 2.x to 3.x.**
@@ -110,8 +109,6 @@ command line argument parsing and execution of cmd2 scripting.
110
109
  - Text file scripting of your application with `run_script` (`@`) and `_relative_run_script` (`@@`)
111
110
  - Powerful and flexible built-in Python scripting of your application using the `run_pyscript`
112
111
  command
113
- - Transcripts for use with built-in regression can be automatically generated from `history -t` or
114
- `run_script -t`
115
112
 
116
113
  ## Installation
117
114
 
@@ -142,7 +139,7 @@ examples.
142
139
  - [cmd2 example applications](https://github.com/python-cmd2/cmd2/tree/main/examples)
143
140
  - Basic cmd2 examples to demonstrate how to use various features
144
141
  - [Advanced Examples](https://github.com/jayrod/cmd2-example-apps)
145
- - 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
146
143
  application
147
144
  - [Cookiecutter](https://github.com/cookiecutter/cookiecutter) Templates from community
148
145
  - Basic cookiecutter template for cmd2 application :
@@ -25,7 +25,7 @@ applications. It provides a simple API which is an extension of Python's built-i
25
25
  of cmd to make your life easier and eliminates much of the boilerplate code which would be necessary
26
26
  when using cmd.
27
27
 
28
- > :warning: **`cmd2` 3.0.0 has been released and there are some significant backwards
28
+ > :warning: **`cmd2` `3.x` has been released and there are some significant backwards
29
29
  > incompatibilities from version `2.x`. Please see the
30
30
  > [Migration Guide](https://cmd2.readthedocs.io/en/latest/upgrades/) for tips on upgrading from
31
31
  > `cmd2` 2.x to 3.x.**
@@ -77,8 +77,6 @@ command line argument parsing and execution of cmd2 scripting.
77
77
  - Text file scripting of your application with `run_script` (`@`) and `_relative_run_script` (`@@`)
78
78
  - Powerful and flexible built-in Python scripting of your application using the `run_pyscript`
79
79
  command
80
- - Transcripts for use with built-in regression can be automatically generated from `history -t` or
81
- `run_script -t`
82
80
 
83
81
  ## Installation
84
82
 
@@ -109,7 +107,7 @@ examples.
109
107
  - [cmd2 example applications](https://github.com/python-cmd2/cmd2/tree/main/examples)
110
108
  - Basic cmd2 examples to demonstrate how to use various features
111
109
  - [Advanced Examples](https://github.com/jayrod/cmd2-example-apps)
112
- - 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
113
111
  application
114
112
  - [Cookiecutter](https://github.com/cookiecutter/cookiecutter) Templates from community
115
113
  - Basic cookiecutter template for cmd2 application :
@@ -15,7 +15,6 @@ from .argparse_completer import set_default_ap_completer_type
15
15
  from .argparse_custom import (
16
16
  Cmd2ArgumentParser,
17
17
  Cmd2AttributeWrapper,
18
- CompletionItem,
19
18
  register_argparse_argument_parameter,
20
19
  set_default_argument_parser_type,
21
20
  )
@@ -25,6 +24,11 @@ from .command_definition import (
25
24
  CommandSet,
26
25
  with_default_category,
27
26
  )
27
+ from .completion import (
28
+ Choices,
29
+ CompletionItem,
30
+ Completions,
31
+ )
28
32
  from .constants import (
29
33
  COMMAND_NAME,
30
34
  DEFAULT_SHORTCUTS,
@@ -48,10 +52,10 @@ from .rich_utils import RichPrintKwargs
48
52
  from .string_utils import stylize
49
53
  from .styles import Cmd2Style
50
54
  from .utils import (
51
- CompletionMode,
52
55
  CustomCompletionSettings,
53
56
  Settable,
54
57
  categorize,
58
+ set_default_str_sort_key,
55
59
  )
56
60
 
57
61
  __all__: list[str] = [ # noqa: RUF022
@@ -60,7 +64,6 @@ __all__: list[str] = [ # noqa: RUF022
60
64
  # Argparse Exports
61
65
  'Cmd2ArgumentParser',
62
66
  'Cmd2AttributeWrapper',
63
- 'CompletionItem',
64
67
  'register_argparse_argument_parameter',
65
68
  'set_default_ap_completer_type',
66
69
  'set_default_argument_parser_type',
@@ -71,6 +74,10 @@ __all__: list[str] = [ # noqa: RUF022
71
74
  'Statement',
72
75
  # Colors
73
76
  "Color",
77
+ # Completion
78
+ 'Choices',
79
+ 'CompletionItem',
80
+ 'Completions',
74
81
  # Decorators
75
82
  'with_argument_list',
76
83
  'with_argparser',
@@ -92,10 +99,10 @@ __all__: list[str] = [ # noqa: RUF022
92
99
  # String Utils
93
100
  'stylize',
94
101
  # Styles,
95
- "Cmd2Style",
102
+ 'Cmd2Style',
96
103
  # Utilities
97
104
  'categorize',
98
- 'CompletionMode',
99
105
  'CustomCompletionSettings',
100
106
  'Settable',
107
+ 'set_default_str_sort_key',
101
108
  ]