Skip to content

Commit

Permalink
Updated a couple files in the examples directory due to changes in al…
Browse files Browse the repository at this point in the history
…ias command
  • Loading branch information
tleonhardt committed Sep 27, 2018
1 parent 75f0ae0 commit b79790d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/.cmd2rc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
alias ls !ls -hal
alias pwd !pwd
alias create ls !ls -hal
alias create pwd !pwd
7 changes: 3 additions & 4 deletions examples/arg_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit b79790d

Please sign in to comment.