Metadata-Version: 1.1
Name: docopt-cmd
Version: 0.0.1
Summary: Pythonic commands and subcommands for docopt
Home-page: http://docopt.org
Author: Keerthan Jaic
Author-email: jckeerthan@gmail.com
License: MIT
Description: ==========================================
        Simple commands and subcommands for docopt
        ==========================================
        ...
        
        
        Example
        -------
        .. code-block:: python
        
            """Do somethings
        
            Usage:
                example.py [-vfr] do (a|b)
        
            Options:
                -v --verbose    Be verbose.
                -f --force      Force.
                -r --random     Huh?.
            """
            from docopt import docopt
            from docopt_cmd import cmd
        
            def main():
                args = docopt(__doc__)
                #print(args)
        
                cmd.dispatch(args)
        
            #explicitly specify spec and options to pass as arguments
            @cmd('do a', force='--force')
            def something(force):
                print('doing a')
                print(force)
        
            #or use magic
            @cmd
            def do_b(random):
                print 'doing b'
                print random
        
            if __name__ == '__main__':
                main()
        
Keywords: option arguments parsing optparse argparse getopt,command,subcommand
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: License :: OSI Approved :: MIT License
