diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-11 09:43:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-11 09:43:13 -0500 |
commit | 6895dea2e19210093e38fa411ef28dfb7f99c32c (patch) | |
tree | 23f40707099324197b47ba5a4f45dd558b6d5b82 /cmd2.py | |
parent | 0a03ab88f8bb70cc2f384c0b98a18bdead7bd417 (diff) | |
parent | 3607a39471eac8123e69b9416e6d77ce5d5b5ddf (diff) | |
download | cmd2-git-6895dea2e19210093e38fa411ef28dfb7f99c32c.tar.gz |
Merge pull request #248 from python-cmd2/argparse_bugfixes
Argparse bugfix
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -248,9 +248,9 @@ def with_argument_parser(argparser): argparse.ArgumentParser. """ def arg_decorator(func): - def cmd_wrapper(instance, arg): + def cmd_wrapper(instance, cmdline): # Use shlex to split the command line into a list of arguments based on shell rules - lexed_arglist = shlex.split(arg, posix=POSIX_SHLEX) + lexed_arglist = shlex.split(cmdline, posix=POSIX_SHLEX) # If not using POSIX shlex, make sure to strip off outer quotes for convenience if not POSIX_SHLEX and STRIP_QUOTES_FOR_NON_POSIX: temp_arglist = [] @@ -258,7 +258,7 @@ def with_argument_parser(argparser): temp_arglist.append(strip_quotes(arg)) lexed_arglist = temp_arglist opts = argparser.parse_args(lexed_arglist) - func(instance, arg, opts) + func(instance, cmdline, opts) # argparser defaults the program name to sys.argv[0] # we want it to be the name of our command |