summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-27 19:58:26 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-27 19:58:26 -0400
commitb79790d5e8259376cbf0201d1d69f9895492aeef (patch)
treefd5dda5f481f6c64933b1b6329053b1051d605da
parent75f0ae0b0beb47495e6f45a193f68a9c49357648 (diff)
downloadcmd2-git-b79790d5e8259376cbf0201d1d69f9895492aeef.tar.gz
Updated a couple files in the examples directory due to changes in alias command
-rw-r--r--examples/.cmd2rc4
-rwxr-xr-xexamples/arg_print.py7
2 files changed, 5 insertions, 6 deletions
diff --git a/examples/.cmd2rc b/examples/.cmd2rc
index 4ffedab9..cedcbe20 100644
--- a/examples/.cmd2rc
+++ b/examples/.cmd2rc
@@ -1,2 +1,2 @@
-alias ls !ls -hal
-alias pwd !pwd
+alias create ls !ls -hal
+alias create pwd !pwd
diff --git a/examples/arg_print.py b/examples/arg_print.py
index 4f0ca709..6b7d030e 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 get 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