forked from jmoiron/python-cmdparse
-
Notifications
You must be signed in to change notification settings - Fork 0
A command line parser for CVS-like commands, integrated with optparse
License
pombredanne/python-cmdparse
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
cmdparse is a command line parser that works with CVS style
commands. Each command can have its own optparse settings.
Install it with the usual setuptools usage:
$ python setup.py install
Example usage:
import cmdparse
class EchoCommand(cmdparse.Command):
def __init__(self):
cmdparse.Command.__init__(self, "echo", summary="echo a string")
self.add_option("-c", "--count", type="int",
default="1", help="number of times to echo")
def run(self, options, args):
for i in xrange(options.count):
print " ".join(args)
parser = cmdparse.CommandParser()
parser.add_command(EchoCommand())
(command, options, args) = parser.parse_args()
command.run(options, args)
About
A command line parser for CVS-like commands, integrated with optparse
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published