Skip to content

Instantly share code, notes, and snippets.

$ pip install commandr
@kevinballard
kevinballard / commandr_example.txt
Created May 22, 2013 22:10
Example interaction with commandr.
$ python example.py
> Command must be specified
>
> General Commands:
> greet
$ python example.py greet
> All options without default values must be specified
>
> Current Options:
@kevinballard
kevinballard / example.py
Created May 22, 2013 22:04
Example script for commandr.
from commandr import command, Run
@command('greet')
def Hi(name, title='Mr.', times=1):
'''Greet someone.
Arguments:
name - Name to greet.
title - Title of the person to greet.
times - Number of times to say the greeting. '''
greeting = 'Hi %s %s!' % (title, name)