diff options
author | kotfu <kotfu@kotfu.net> | 2018-04-21 16:24:45 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-04-21 16:24:45 -0600 |
commit | 27b5ab6da0955fda521febada0070d4b53c7e255 (patch) | |
tree | 7c959f0ea43b80eedd323da77bc0a4f71a172708 /cmd2/parsing.py | |
parent | 2350ec2a9b137ee3026efff1b1b3537d99cf19f2 (diff) | |
download | cmd2-git-27b5ab6da0955fda521febada0070d4b53c7e255.tar.gz |
A bit of renaming
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r-- | cmd2/parsing.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 41a3ed0b..41ce5743 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -9,7 +9,16 @@ import cmd2 class Command(): """Store the results of a parsed command.""" - pass + def __init__(self, rawinput): + self.raw = rawinput + self.command = None + self.multilineCommand = None + self.args = None + self.terminator = None + self.suffix = None + self.pipeTo = None + self.output = None + self.outputTo = None class CommandParser(): """Parse raw text into command components.""" @@ -28,16 +37,7 @@ class CommandParser(): self.multilineCommands = multilineCommands def parseString(self, rawinput): - result = Command() - result.raw = rawinput - result.command = None - result.multilineCommand = None - result.args = None - result.terminator = None - result.suffix = None - result.pipeTo = None - result.output = None - result.outputTo = None + result = Command(rawinput) # strip C-style and C++-style comments # shlex will handle the python/shell style comments for us |