Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,14 +1136,16 @@ def do_cmdenvironment(self, args):
self.stdout.write("""
Commands are case-sensitive: {}
Commands may be terminated with: {}
Command-line arguments allowed: {}
Arguments at invocation allowed: {}
Output redirection and pipes allowed: {}
Parsing of @options commands:
Use POSIX-style argument parser (vs Windows): {}
Strip Quotes when using Windows-style argument parser: {}
Use a list of arguments instead of a single argument string: {}
Shell lexer mode for command argument splitting: {}
Strip Quotes after splitting arguments: {}
Argument type: {}
\n""".format(not self.case_insensitive, str(self.terminators), self.allow_cli_args, self.allow_redirection,
POSIX_SHLEX, STRIP_QUOTES_FOR_NON_POSIX, USE_ARG_LIST))
"POSIX" if POSIX_SHLEX else "non-POSIX",
"True" if STRIP_QUOTES_FOR_NON_POSIX and not POSIX_SHLEX else "False",
"List of argument strings" if USE_ARG_LIST else "string of space-separated arguments"))

def do_help(self, arg):
"""List available commands with "help" or detailed help with "help cmd"."""
Expand Down
19 changes: 11 additions & 8 deletions tests/test_cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,19 @@ def test_base_cmdenvironment(base_app):
out = run_cmd(base_app, 'cmdenvironment')
expected = normalize("""

Commands are case-sensitive: False
Commands may be terminated with: [';']
Command-line arguments allowed: True
Output redirection and pipes allowed: True
Commands are case-sensitive: {}
Commands may be terminated with: {}
Arguments at invocation allowed: {}
Output redirection and pipes allowed: {}
Parsing of @options commands:
Use POSIX-style argument parser (vs Windows): {}
Strip Quotes when using Windows-style argument parser: {}
Use a list of arguments instead of a single argument string: {}
Shell lexer mode for command argument splitting: {}
Strip Quotes after splitting arguments: {}
Argument type: {}

""".format(cmd2.POSIX_SHLEX, cmd2.STRIP_QUOTES_FOR_NON_POSIX, cmd2.USE_ARG_LIST))
""".format(not base_app.case_insensitive, base_app.terminators, base_app.allow_cli_args, base_app.allow_redirection,
"POSIX" if cmd2.POSIX_SHLEX else "non-POSIX",
"True" if cmd2.STRIP_QUOTES_FOR_NON_POSIX and not cmd2.POSIX_SHLEX else "False",
"List of argument strings" if cmd2.USE_ARG_LIST else "string of space-separated arguments"))
assert out == expected

def test_base_load(base_app, request):
Expand Down