Skip to content

Commit 1b829f1

Browse files
authored
Merge pull request #134 from python-cmd2/reword_cmdenvironnment
Reword cmdenvironnment
2 parents 89f58e2 + 891ca5c commit 1b829f1

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

cmd2.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,14 +1136,16 @@ def do_cmdenvironment(self, args):
11361136
self.stdout.write("""
11371137
Commands are case-sensitive: {}
11381138
Commands may be terminated with: {}
1139-
Command-line arguments allowed: {}
1139+
Arguments at invocation allowed: {}
11401140
Output redirection and pipes allowed: {}
11411141
Parsing of @options commands:
1142-
Use POSIX-style argument parser (vs Windows): {}
1143-
Strip Quotes when using Windows-style argument parser: {}
1144-
Use a list of arguments instead of a single argument string: {}
1142+
Shell lexer mode for command argument splitting: {}
1143+
Strip Quotes after splitting arguments: {}
1144+
Argument type: {}
11451145
\n""".format(not self.case_insensitive, str(self.terminators), self.allow_cli_args, self.allow_redirection,
1146-
POSIX_SHLEX, STRIP_QUOTES_FOR_NON_POSIX, USE_ARG_LIST))
1146+
"POSIX" if POSIX_SHLEX else "non-POSIX",
1147+
"True" if STRIP_QUOTES_FOR_NON_POSIX and not POSIX_SHLEX else "False",
1148+
"List of argument strings" if USE_ARG_LIST else "string of space-separated arguments"))
11471149

11481150
def do_help(self, arg):
11491151
"""List available commands with "help" or detailed help with "help cmd"."""

tests/test_cmd2.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,19 @@ def test_base_cmdenvironment(base_app):
222222
out = run_cmd(base_app, 'cmdenvironment')
223223
expected = normalize("""
224224
225-
Commands are case-sensitive: False
226-
Commands may be terminated with: [';']
227-
Command-line arguments allowed: True
228-
Output redirection and pipes allowed: True
225+
Commands are case-sensitive: {}
226+
Commands may be terminated with: {}
227+
Arguments at invocation allowed: {}
228+
Output redirection and pipes allowed: {}
229229
Parsing of @options commands:
230-
Use POSIX-style argument parser (vs Windows): {}
231-
Strip Quotes when using Windows-style argument parser: {}
232-
Use a list of arguments instead of a single argument string: {}
230+
Shell lexer mode for command argument splitting: {}
231+
Strip Quotes after splitting arguments: {}
232+
Argument type: {}
233233
234-
""".format(cmd2.POSIX_SHLEX, cmd2.STRIP_QUOTES_FOR_NON_POSIX, cmd2.USE_ARG_LIST))
234+
""".format(not base_app.case_insensitive, base_app.terminators, base_app.allow_cli_args, base_app.allow_redirection,
235+
"POSIX" if cmd2.POSIX_SHLEX else "non-POSIX",
236+
"True" if cmd2.STRIP_QUOTES_FOR_NON_POSIX and not cmd2.POSIX_SHLEX else "False",
237+
"List of argument strings" if cmd2.USE_ARG_LIST else "string of space-separated arguments"))
235238
assert out == expected
236239

237240
def test_base_load(base_app, request):

0 commit comments

Comments
 (0)