README update
authorAlexander Solovyov <alexander@solovyov.net>
Mon, 15 Nov 2010 14:48:13 +0100
changeset 134 43702c4c4139
parent 133 04535357557e
child 135 444518c54a66
README update
README
--- a/README	Sat Nov 13 01:40:52 2010 +0300
+++ b/README	Mon Nov 15 14:48:13 2010 +0100
@@ -20,10 +20,10 @@
 
   @command(usage='%name [-n] MESSAGE')
   def main(message,
-           nonewline=('n', False, 'don\'t print a newline')):
+           no_newline=('n', False, 'don\'t print a newline')):
       'Simple echo program'
       sys.stdout.write(message)
-      if not nonewline:
+      if not no_newline:
           sys.stdout.write('\n')
 
   if __name__ == '__main__':
@@ -37,13 +37,20 @@
 
   options:
 
-   -n --nonewline  don't print a newline
-   -h --help       show help
+   -n --no-newline  don't print a newline
+   -h --help        show help
 
-I think this mostly describes what's going on, except that I'd like to mention
-one interesting feature - if you are using long name for option, you can use
-only partial name, for example ``./echo.py --nonew`` a is valid command
-line. This is also true for subcommands: read about that and everything else
-you'd like to know in `documentation`_.
+As you can see, here we have defined option to not print newline: keyword
+argument name is a long name for option, default value is a 3-tuple, containing
+short name for an option (can be empty), default value (on base of which
+processing is applied - `see description`_) and a help string.
+
+Underscores in long names are converted into dashes.
+
+If you are calling a command with option using long name, you can supply it
+partially. In this case it could look like ``./echo.py --nonew``. This is also
+true for subcommands: read about them and everything else you'd like to know in
+`documentation`_.
 
 .. _documentation: http://hg.piranha.org.ua/opster/docs/
+.. _see description: http://hg.piranha.org.ua/opster/docs/overview.html