cmd2 3.5.0__tar.gz → 3.5.1__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.
- {cmd2-3.5.0 → cmd2-3.5.1}/CHANGELOG.md +6 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/PKG-INFO +1 -1
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/argparse_completer.py +1 -1
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/cmd2.py +5 -11
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/constants.py +3 -3
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/parsing.py +10 -10
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2.egg-info/PKG-INFO +1 -1
- {cmd2-3.5.0 → cmd2-3.5.1}/.pre-commit-config.yaml +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/.prettierignore +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/.prettierrc +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/GEMINI.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/LICENSE +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/MANIFEST.in +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/Makefile +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/README.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/__init__.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/argparse_custom.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/clipboard.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/colors.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/command_definition.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/decorators.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/exceptions.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/history.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/plugin.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/py.typed +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/py_bridge.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/rich_utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/rl_utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/string_utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/styles.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/terminal_utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/transcript.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2/utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2.egg-info/SOURCES.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2.egg-info/dependency_links.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2.egg-info/requires.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2.egg-info/top_level.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/cmd2.png +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/codecov.yml +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/argparse_completer.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/argparse_custom.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/clipboard.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/cmd.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/colors.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/command_definition.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/constants.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/decorators.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/exceptions.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/history.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/index.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/parsing.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/plugin.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/py_bridge.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/rich_utils.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/rl_utils.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/string_utils.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/styles.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/terminal_utils.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/transcript.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/api/utils.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/doc_conventions.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/examples/alternate_event_loops.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/examples/examples.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/examples/getting_started.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/examples/index.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/argument_processing.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/builtin_commands.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/clipboard.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/commands.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/completion.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/disable_commands.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/embedded_python_shells.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/generating_output.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/help.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/history.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/hooks.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/index.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/initialization.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/misc.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/modular_commands.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/multiline_commands.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/os.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/packaging.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/plugins.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/prompt.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/redirection.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/scripting.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/settings.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/shortcuts_aliases_macros.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/startup_commands.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/table_creation.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/theme.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/features/transcripts.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/index.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/javascripts/readthedocs.js +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/migrating/incompatibilities.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/migrating/index.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/migrating/minimum.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/migrating/next_steps.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/migrating/why.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/mixins/index.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/mixins/mixin_template.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/overrides/main.html +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/overview/alternatives.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/overview/index.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/overview/installation.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/overview/integrating.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/overview/resources.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/stylesheets/cmd2.css +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/testing.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/docs/upgrades.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/.cmd2rc +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/README.md +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/argparse_completion.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/argparse_example.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/async_call.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/async_printing.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/basic_completion.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/cmd_as_argument.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/color.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/command_sets.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/custom_parser.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/custom_types.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/default_categories.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/dynamic_commands.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/environment.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/event_loops.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/exit_code.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/getting_started.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/hello_cmd2.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/help_categories.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/hooks.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/migrating.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/mixin.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/modular_commands/__init__.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/modular_commands/commandset_basic.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/modular_commands/commandset_complex.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/modular_commands/commandset_custominit.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/modular_commands.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/paged_output.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/persistent_history.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/pretty_print.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/python_scripting.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/read_input.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/remove_builtin_commands.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/remove_settable.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/rich_tables.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/rich_theme.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/scripts/arg_printer.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/scripts/conditional.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/scripts/nested.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/scripts/quit.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/scripts/save_help_text.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/scripts/script.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/scripts/script.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/tmux_launch.sh +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/tmux_split.sh +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/transcript_example.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/transcripts/exampleSession.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/transcripts/pirate.transcript +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/transcripts/quit.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/transcripts/transcript_regex.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/examples/unicode_commands.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/mkdocs.yml +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/package.json +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/pyproject.toml +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/ruff.toml +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/scripts/validate_tag.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/setup.cfg +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/.cmd2rc +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/__init__.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/conftest.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/echo.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/environment.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/help.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/py_locals.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/pyscript_dir.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/raises_exception.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/recursive.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/self_in_py.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/stdout_capture.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/pyscript/stop.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/relative_multiple.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/script.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/script.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/scripts/binary.bin +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/scripts/empty.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/scripts/help.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/scripts/nested.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/scripts/one_down.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/scripts/postcmds.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/scripts/precmds.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/scripts/utf8.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_argparse.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_argparse_completer.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_argparse_custom.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_argparse_subcommands.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_async_alert.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_categories.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_cmd2.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_commandset.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_completion.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_future_annotations.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_history.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_parsing.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_plugin.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_rich_utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_run_pyscript.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_string_utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_terminal_utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_transcript.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_utils.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/test_utils_defining_class.py +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/bol_eol.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/characterclass.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/dotstar.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/extension_notation.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/failure.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/from_cmdloop.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/multiline_no_regex.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/multiline_regex.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/no_output.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/no_output_last.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/singleslash.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/slashes_escaped.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/slashslash.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/spaces.txt +0 -0
- {cmd2-3.5.0 → cmd2-3.5.1}/tests/transcripts/word_boundaries.txt +0 -0
|
@@ -637,7 +637,7 @@ class ArgparseCompleter:
|
|
|
637
637
|
if parser:
|
|
638
638
|
completer_type = self._cmd2_app._determine_ap_completer_type(parser)
|
|
639
639
|
completer = completer_type(parser, self._cmd2_app)
|
|
640
|
-
completer.print_help(tokens[1:])
|
|
640
|
+
completer.print_help(tokens[1:], file=file)
|
|
641
641
|
return
|
|
642
642
|
|
|
643
643
|
self._parser.print_help(file=file)
|
|
@@ -1666,10 +1666,8 @@ class Cmd:
|
|
|
1666
1666
|
**On Failure**
|
|
1667
1667
|
- Two empty lists
|
|
1668
1668
|
"""
|
|
1669
|
-
import copy
|
|
1670
|
-
|
|
1671
1669
|
unclosed_quote = ''
|
|
1672
|
-
quotes_to_try =
|
|
1670
|
+
quotes_to_try = [*constants.QUOTES]
|
|
1673
1671
|
|
|
1674
1672
|
tmp_line = line[:endidx]
|
|
1675
1673
|
tmp_endidx = endidx
|
|
@@ -3721,8 +3719,7 @@ class Cmd:
|
|
|
3721
3719
|
return
|
|
3722
3720
|
|
|
3723
3721
|
# Unquote redirection and terminator tokens
|
|
3724
|
-
tokens_to_unquote = constants.REDIRECTION_TOKENS
|
|
3725
|
-
tokens_to_unquote.extend(self.statement_parser.terminators)
|
|
3722
|
+
tokens_to_unquote = [*constants.REDIRECTION_TOKENS, *self.statement_parser.terminators]
|
|
3726
3723
|
utils.unquote_specific_tokens(args.command_args, tokens_to_unquote)
|
|
3727
3724
|
|
|
3728
3725
|
# Build the alias value string
|
|
@@ -3801,8 +3798,7 @@ class Cmd:
|
|
|
3801
3798
|
"""List some or all aliases as 'alias create' commands."""
|
|
3802
3799
|
self.last_result = {} # dict[alias_name, alias_value]
|
|
3803
3800
|
|
|
3804
|
-
tokens_to_quote = constants.REDIRECTION_TOKENS
|
|
3805
|
-
tokens_to_quote.extend(self.statement_parser.terminators)
|
|
3801
|
+
tokens_to_quote = [*constants.REDIRECTION_TOKENS, *self.statement_parser.terminators]
|
|
3806
3802
|
|
|
3807
3803
|
to_list = utils.remove_duplicates(args.names) if args.names else sorted(self.aliases, key=self.default_sort_key)
|
|
3808
3804
|
|
|
@@ -3964,8 +3960,7 @@ class Cmd:
|
|
|
3964
3960
|
return
|
|
3965
3961
|
|
|
3966
3962
|
# Unquote redirection and terminator tokens
|
|
3967
|
-
tokens_to_unquote = constants.REDIRECTION_TOKENS
|
|
3968
|
-
tokens_to_unquote.extend(self.statement_parser.terminators)
|
|
3963
|
+
tokens_to_unquote = [*constants.REDIRECTION_TOKENS, *self.statement_parser.terminators]
|
|
3969
3964
|
utils.unquote_specific_tokens(args.command_args, tokens_to_unquote)
|
|
3970
3965
|
|
|
3971
3966
|
# Build the macro value string
|
|
@@ -4087,8 +4082,7 @@ class Cmd:
|
|
|
4087
4082
|
"""List macros."""
|
|
4088
4083
|
self.last_result = {} # dict[macro_name, macro_value]
|
|
4089
4084
|
|
|
4090
|
-
tokens_to_quote = constants.REDIRECTION_TOKENS
|
|
4091
|
-
tokens_to_quote.extend(self.statement_parser.terminators)
|
|
4085
|
+
tokens_to_quote = [*constants.REDIRECTION_TOKENS, *self.statement_parser.terminators]
|
|
4092
4086
|
|
|
4093
4087
|
to_list = utils.remove_duplicates(args.names) if args.names else sorted(self.macros, key=self.default_sort_key)
|
|
4094
4088
|
|
|
@@ -7,12 +7,12 @@ INFINITY = float('inf')
|
|
|
7
7
|
|
|
8
8
|
# Used for command parsing, output redirection, tab completion and word
|
|
9
9
|
# breaks. Do not change.
|
|
10
|
-
QUOTES =
|
|
10
|
+
QUOTES = ('"', "'")
|
|
11
11
|
REDIRECTION_PIPE = '|'
|
|
12
12
|
REDIRECTION_OUTPUT = '>'
|
|
13
13
|
REDIRECTION_APPEND = '>>'
|
|
14
|
-
REDIRECTION_CHARS =
|
|
15
|
-
REDIRECTION_TOKENS =
|
|
14
|
+
REDIRECTION_CHARS = (REDIRECTION_PIPE, REDIRECTION_OUTPUT)
|
|
15
|
+
REDIRECTION_TOKENS = (REDIRECTION_PIPE, REDIRECTION_OUTPUT, REDIRECTION_APPEND)
|
|
16
16
|
COMMENT_CHAR = '#'
|
|
17
17
|
MULTILINE_TERMINATOR = ';'
|
|
18
18
|
|
|
@@ -298,10 +298,12 @@ class StatementParser:
|
|
|
298
298
|
# the string (\Z matches the end of the string even if it
|
|
299
299
|
# contains multiple lines)
|
|
300
300
|
#
|
|
301
|
-
invalid_command_chars =
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
301
|
+
invalid_command_chars = (
|
|
302
|
+
*constants.QUOTES,
|
|
303
|
+
*constants.REDIRECTION_CHARS,
|
|
304
|
+
*self.terminators,
|
|
305
|
+
)
|
|
306
|
+
|
|
305
307
|
# escape each item so it will for sure get treated as a literal
|
|
306
308
|
second_group_items = [re.escape(x) for x in invalid_command_chars]
|
|
307
309
|
# add the whitespace and end of string, not escaped because they
|
|
@@ -352,9 +354,8 @@ class StatementParser:
|
|
|
352
354
|
return False, errmsg
|
|
353
355
|
|
|
354
356
|
errmsg = 'cannot contain: whitespace, quotes, '
|
|
355
|
-
|
|
356
|
-
errchars
|
|
357
|
-
errchars.extend(self.terminators)
|
|
357
|
+
|
|
358
|
+
errchars = (*constants.REDIRECTION_CHARS, *self.terminators)
|
|
358
359
|
errmsg += ', '.join([shlex.quote(x) for x in errchars])
|
|
359
360
|
|
|
360
361
|
match = self._command_pattern.search(word)
|
|
@@ -677,9 +678,8 @@ class StatementParser:
|
|
|
677
678
|
:param tokens: the tokens as parsed by shlex
|
|
678
679
|
:return: a new list of tokens, further split using punctuation
|
|
679
680
|
"""
|
|
680
|
-
|
|
681
|
-
punctuation
|
|
682
|
-
punctuation.extend(constants.REDIRECTION_CHARS)
|
|
681
|
+
# Using a set for faster lookups
|
|
682
|
+
punctuation = {*self.terminators, *constants.REDIRECTION_CHARS}
|
|
683
683
|
|
|
684
684
|
punctuated_tokens = []
|
|
685
685
|
|
|
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
|
|
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
|
|
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
|
|
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
|