diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-30 11:17:04 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-30 11:17:04 -0400 |
commit | 81ad085cffc8f8af7fb7884bcc5db6fcede09df6 (patch) | |
tree | a197a6c81767f10b62d6ac6acfd46e42357a8289 /examples/arg_print.py | |
parent | 85a21ef39467dc24a6f6f8c4f3ac656f24d6ff90 (diff) | |
parent | 61d5703cd3586b3460669a6260cf903c9863b240 (diff) | |
download | cmd2-git-81ad085cffc8f8af7fb7884bcc5db6fcede09df6.tar.gz |
Merged master into transcript_fixes branch and resolved conflicts
Diffstat (limited to 'examples/arg_print.py')
-rwxr-xr-x | examples/arg_print.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/arg_print.py b/examples/arg_print.py index 4f0ca709..f2168126 100755 --- a/examples/arg_print.py +++ b/examples/arg_print.py @@ -2,13 +2,12 @@ # coding=utf-8 """A simple example demonstrating the following: 1) How arguments and options get parsed and passed to commands - 2) How to change what syntax get parsed as a comment and stripped from - the arguments + 2) How to change what syntax gets parsed as a comment and stripped from the arguments This is intended to serve as a live demonstration so that developers can experiment with and understand how command and argument parsing work. -It also serves as an example of how to create command aliases (shortcuts). +It also serves as an example of how to create shortcuts. """ import argparse @@ -18,7 +17,7 @@ class ArgumentAndOptionPrinter(cmd2.Cmd): """ Example cmd2 application where we create commands that just print the arguments they are called with.""" def __init__(self): - # Create command aliases which are shorter + # Create command shortcuts which are typically 1 character abbreviations which can be used in place of a command self.shortcuts.update({'$': 'aprint', '%': 'oprint'}) # Make sure to call this super class __init__ *after* setting and/or updating shortcuts |