Commits

Andy Mikhailenko committed 8bce6f1

Fixed errors in documentation.

Comments (0)

Files changed (2)

 
 A very simple application with one command::
 
-    @arg('text')  # signature is same as ArgumentParser.add_argument
-    def echo(args):
-        print args.text
-    
+    @command
+    def echo(text='hello'):
+        print text
+   
     parser = ArghParser()
     parser.add_commands([echo])
 
     if __name__ == '__main__':
         parser.dispatch()
 
+The powerful API of `argparse` is also available::
+
+    @arg('text', default='hello world', nargs='+', help='The message')
+    def echo(args):
+        print args.text
+
+The approaches can be safely combined.
+
 Documentation
 -------------
 

docs/tutorial.rst

 Dive in
 -------
 
-Defining commands is dead simple::
+Defining and running commands is dead simple::
 
     from argh import *
     
     def load(path, format='json'):
         print loaders[format].load(path)
 
-    argh.dispatch()
+    p = ArghParser()
+    p.add_commands([load])
+    p.dispatch()
 
 And then call your script like this::