Skip to content

Commit

Permalink
Fixed a minor typo in a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Leonhardt committed Feb 13, 2017
1 parent 3f2ae2c commit 65aa043
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def set_strip_quotes(val):


def set_use_arg_list(val):
""" Allows user of cmd2 to choose between passing @options commands an argument string or list or arg strings.
""" Allows user of cmd2 to choose between passing @options commands an argument string or list of arg strings.
:param val: bool - True => arg is a list of strings, False => arg is a string (for @options commands)
"""
Expand Down Expand Up @@ -592,11 +592,11 @@ def poutput(self, msg):

def perror(self, errmsg, exception_type=None, traceback_war=True):
""" Print error message to sys.stderr and if debug is true, print an exception Traceback if one exists.
:param errmsg: str - error message to print out
:param exception_type: str - (optional) type of exception which precipitated this error message
:param traceback_war: bool - (optional) if True, print a message to let user know they can enable debug
:return:
:return:
"""
if self.debug:
traceback.print_exc()
Expand Down Expand Up @@ -935,15 +935,15 @@ def parsed(self, raw, **kwargs):

def postparsing_precmd(self, statement):
"""This runs after parsing the command-line, but before anything else; even before adding cmd to history.
NOTE: This runs before precmd() and prior to any potential output redirection or piping.
If you wish to fatally fail this command and exit the application entirely, set stop = True.
If you wish to just fail this command you can do so by raising an exception:
raise EmptyStatement - will silently fail and do nothing
raise <AnyOtherException> - will fail and print an error message
:param statement: - the parsed command-line statement
:return: (bool, statement) - (stop, statement) containing a potentially modified version of the statement
"""
Expand All @@ -952,7 +952,7 @@ def postparsing_precmd(self, statement):

def postparsing_postcmd(self, stop):
"""This runs after everything else, including after postcmd().
:param stop: bool - True implies the entire application should exit.
:return: bool - True implies the entire application should exit.
"""
Expand All @@ -972,9 +972,9 @@ def func_named(self, arg):

def onecmd_plus_hooks(self, line):
"""
:param line:
:return:
:param line:
:return:
"""
# The outermost level of try/finally nesting can be condensed once
# Python 2.4 support can be dropped.
Expand Down Expand Up @@ -1257,33 +1257,33 @@ def do_set(self, arg):

def do_pause(self, text):
"""Displays the specified text then waits for the user to press <Enter>.
Usage: pause [text]
:param text: str - Text to display to the user (default: blank line)
"""
sm.input(text + '\n')

def help_pause(self):
"""Print help for do_pause()."""
help_str = """Displays the specified text then waits for the user to press <Enter>.
Usage: pause [text]"""
self.stdout.write("{}\n".format(help_str))

def do_shell(self, command):
"""Execute a command as if at the OS prompt.
Usage: shell command
:param command: str - shell command to execute
"""
os.system(command)

def help_shell(self):
"""Print help for do_shell()."""
help_str = """Execute a command as if at the OS prompt.
Usage: shell cmd"""
self.stdout.write("{}\n".format(help_str))

Expand Down Expand Up @@ -1374,9 +1374,9 @@ def last_matching(self, arg):

def do_list(self, arg):
"""list [arg]: lists command(s) from history in a flexible/searchable way.
:param arg: str - behavior varies as follows:
* no arg -> list most recent command
* arg is integer -> list one history item, by index
* a..b, a:b, a:, ..b -> list spans from a (or start) to b (or end)
Expand All @@ -1403,20 +1403,20 @@ def help_list(self):

def do_edit(self, arg):
"""Edit a file or command in a text editor.
Usage: edit [N]|[file_path]
:param arg: str - [N]|[file_path]
* **N** - Number of command (from history), or `*` for all commands in history (default: most recent command)
* **file_path** - path to a file to open in editor
The editor used is determined by the ``editor`` settable parameter.
"set editor (program-name)" to change or set the EDITOR environment variable.
The optional arguments are mutually exclusive. Either a command number OR a file name can be supplied.
If neither is supplied, the most recent command in the history is edited.
Edited commands are always run after the editor is closed.
Edited files are run on close if the ``autorun_on_edit`` settable parameter is True.
Expand Down Expand Up @@ -1448,11 +1448,11 @@ def help_edit(self):
help_str = """Edit a file or command in a text editor.
Usage: edit [N]|[file_path]
optional arguments:
N Number of command (from history), or `*` for all commands in history (default: most recent command)
file_path path to a file to open in editor
The editor used is determined by the `editor` settable parameter.
"set editor (program-name" to change or set the EDITOR environment variable.
Expand All @@ -1472,9 +1472,9 @@ def do_save(self, arg):
"""Saves command(s) from history to file.
Usage: save [N] [file_path]
:param arg: str - [N] [filepath]
* **N** - Number of command (from history), or `*` for all commands in history (default: most recent command)
* **file_path** - location to save script of command(s) to (default: value stored in ``default_file_name``)
"""
Expand Down Expand Up @@ -1505,7 +1505,7 @@ def help_save(self):
help_str = """Saves command(s) from history to file.
Usage: save [N] [file_path]
optional arguments:
N - Number of command (from history), or `*` for all commands in history (default: most recent command)
file_path - location to save script of command(s) to (default: value stored in `default_file_name` parameter)"""
Expand All @@ -1531,16 +1531,16 @@ def read_file_or_url(self, fname):

def do__relative_load(self, arg=None):
"""Runs commands in script at file or URL.
Usage: load [file_path]
optional argument:
file_path a file path or URL pointing to a script
default: value stored in `default_file_name` settable param
Script should contain one command per line, just like command would be typed in console.
If this is called from within an already-running script, the filename will be interpreted
If this is called from within an already-running script, the filename will be interpreted
relative to the already-running script's directory.
"""
if arg:
Expand All @@ -1551,9 +1551,9 @@ def do__relative_load(self, arg=None):

def do_load(self, file_path=None):
"""Runs commands in script at file or URL.
Usage: load [file_path]
:param file_path: str - a file path or URL pointing to a script (default: value stored in ``default_file_name``)
:return: bool - True implies application should stop, False to continue like normal
Expand Down Expand Up @@ -1585,9 +1585,9 @@ def do_load(self, file_path=None):
def help_load(self):
"""Print help for do_load()."""
help_str = """Runs commands in script at file or URL.
Usage: load [file_path]
optional argument:
file_path - a file path or URL pointing to a script (default: value stored in `default_file_name` parameter)
Expand All @@ -1597,7 +1597,7 @@ def help_load(self):

def do_run(self, arg):
"""run [arg]: re-runs an earlier command
:param arg: str - determines which command is re-run, as follows:
* no arg -> run most recent command
Expand Down

0 comments on commit 65aa043

Please sign in to comment.