update manpage and support commands title

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-13 21:35:57 +02:00
parent 90bdf04336
commit 9b18b3d79e
2 changed files with 29 additions and 14 deletions

View file

@ -638,16 +638,17 @@ if __name__ == "__main__":
# Main subcommand parser # Main subcommand parser
parser['main'] = argparse.ArgumentParser(description='cdist ' + VERSION) parser['main'] = argparse.ArgumentParser(description='cdist ' + VERSION)
parser['main'].add_argument('-V', '--version', parser['main'].add_argument('-V', '--version',
help='Show version', action='version', help='Show version', action='version',
version='%(prog)s ' + VERSION) version='%(prog)s ' + VERSION)
parser['sub'] = parser['main'].add_subparsers() parser['sub'] = parser['main'].add_subparsers(title="Commands")
# Banner
parser['banner'] = parser['sub'].add_parser('banner', parser['banner'] = parser['sub'].add_parser('banner',
add_help=False) add_help=False)
parser['banner'].set_defaults(func=banner) parser['banner'].set_defaults(func=banner)
# Config
parser['config'] = parser['sub'].add_parser('config', parser['config'] = parser['sub'].add_parser('config',
parents=[parser['most']]) parents=[parser['most']])
parser['config'].add_argument('host', nargs='+', parser['config'].add_argument('host', nargs='+',

View file

@ -10,22 +10,34 @@ cdist - Configuration management
SYNOPSIS SYNOPSIS
-------- --------
cdist [-h] [-b] [-c CDIST_HOME] [-d] [-i MANIFEST] [-p] [-s] [-V] [host [host ...]] cdist [-V|--version]
cdist banner
cdist config [-h] [-d] [-V] [-c CDIST_HOME] [-i MANIFEST] [-p] [-s] host [host ...]
DESCRIPTION DESCRIPTION
----------- -----------
cdist is the frontend executable to the cdist configuration management. cdist is the frontend executable to the cdist configuration management.
cdist supports different as explained below. The options to the main
program are:
-V, --version::
Show version and exit
OPTIONS BANNER
------- -------
Displays the cdist banner.
CONFIG
------
Configure a system
-h, --help:: -h, --help::
Show the help screen Show the help screen
-b, --banner::
Show cdist banner
-c CDIST_HOME, --cdist-home CDIST_HOME:: -c CDIST_HOME, --cdist-home CDIST_HOME::
Instead of using the parent of the bin directory as cdist home, Instead of using the parent of the bin directory as cdist home,
use the specified directory use the specified directory
@ -42,23 +54,25 @@ OPTIONS
-s, --sequential:: -s, --sequential::
Operate on multiple hosts sequentially Operate on multiple hosts sequentially
-V, --version::
Show version and exit
EXAMPLES EXAMPLES
-------- --------
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
# Configure ikq05.ethz.ch with debug enabled # Configure ikq05.ethz.ch with debug enabled
cdist -d ikq05.ethz.ch cdist config -d ikq05.ethz.ch
# Configure hosts in parallel and use a different home directory # Configure hosts in parallel and use a different home directory
cdist -c ~/p/cdist-nutzung -p ikq02.ethz.ch ikq03.ethz.ch ikq04.ethz.ch cdist config -c ~/p/cdist-nutzung \
-p ikq02.ethz.ch ikq03.ethz.ch ikq04.ethz.ch
# Does not need a comment, plain works # Display banner
cdist --banner cdist banner
# Show help
cdist --help cdist --help
# Show Version
cdist --version cdist --version
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------