diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-08-23 00:29:24 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-08-23 00:29:24 -0400 |
commit | 6f1eb6860c546631077ed21bdd36b9d665ac79b5 (patch) | |
tree | 9994bd5ff45af8ae9d91d6e7ea9d60e0794bb832 /cmd2/parsing.py | |
parent | 0ad6b6d5417d0d126dc39550d5416f266cc47ec5 (diff) | |
download | cmd2-git-6f1eb6860c546631077ed21bdd36b9d665ac79b5.tar.gz |
Fixed bug where alias was dropping quotes
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r-- | cmd2/parsing.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py index b67cef10..67e97c2b 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -5,7 +5,7 @@ import os import re import shlex -from typing import List, Tuple, Dict +from typing import List, Tuple, Dict, Union from . import constants from . import utils @@ -105,6 +105,17 @@ class Statement(str): rtn = None return rtn + @property + def arg_list(self) -> Union[List[str], None]: + """ + Returns a list of the arguments to the command, not including any output + redirection or terminators. quoted arguments remain quoted. + """ + if self.args is None: + return None + + return self.args.split() + def __setattr__(self, name, value): """Statement instances should feel immutable; raise ValueError""" raise ValueError |