diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-04-12 15:45:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 15:45:41 -0700 |
commit | 95bd80efee7f4f607af4f58dec83024d5d6f78e1 (patch) | |
tree | ab8c02a417e611b8627ff1c393aa60e0db44ec97 /cmd2.py | |
parent | ddad9ebf9bc4f8158536719e9a4b8ca2e6753e51 (diff) | |
parent | ed3ff0ca9150d2b446bd545042db7a6d367f0cd9 (diff) | |
download | cmd2-git-95bd80efee7f4f607af4f58dec83024d5d6f78e1.tar.gz |
Merge pull request #351 from python-cmd2/bugfix/350
Pass the return value back through for wrapped functions.
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -380,7 +380,7 @@ def with_argument_list(func): @functools.wraps(func) def cmd_wrapper(self, cmdline): lexed_arglist = parse_quoted_string(cmdline) - func(self, lexed_arglist) + return func(self, lexed_arglist) cmd_wrapper.__doc__ = func.__doc__ return cmd_wrapper @@ -400,7 +400,7 @@ def with_argparser_and_unknown_args(argparser): def cmd_wrapper(instance, cmdline): lexed_arglist = parse_quoted_string(cmdline) args, unknown = argparser.parse_known_args(lexed_arglist) - func(instance, args, unknown) + return func(instance, args, unknown) # argparser defaults the program name to sys.argv[0] # we want it to be the name of our command @@ -442,7 +442,7 @@ def with_argparser(argparser): def cmd_wrapper(instance, cmdline): lexed_arglist = parse_quoted_string(cmdline) args = argparser.parse_args(lexed_arglist) - func(instance, args) + return func(instance, args) # argparser defaults the program name to sys.argv[0] # we want it to be the name of our command |