From 27b5ab6da0955fda521febada0070d4b53c7e255 Mon Sep 17 00:00:00 2001 From: kotfu Date: Sat, 21 Apr 2018 16:24:45 -0600 Subject: A bit of renaming --- cmd2/parsing.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'cmd2/parsing.py') 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 -- cgit v1.2.1