Bugfix: --beta on the commandline does not seem to work #635

Fix argparse parsers.
This commit is contained in:
Darko Poljak 2018-02-28 23:29:45 +01:00
parent 3fb7e33305
commit 7ccc959ebd
2 changed files with 4 additions and 10 deletions

View file

@ -131,7 +131,7 @@ def get_parsers():
# Main subcommand parser
parser['main'] = argparse.ArgumentParser(
description='cdist ' + cdist.VERSION, parents=[parser['loglevel']])
description='cdist ' + cdist.VERSION)
parser['main'].add_argument(
'-V', '--version', help='Show version.', action='version',
version='%(prog)s ' + cdist.VERSION)
@ -289,10 +289,7 @@ def get_parsers():
parser['install'].set_defaults(func=cdist.install.Install.commandline)
# Inventory
parser['inventory'] = parser['sub'].add_parser(
'inventory', parents=[parser['loglevel'], parser['beta'],
parser['common'],
parser['inventory_common']])
parser['inventory'] = parser['sub'].add_parser('inventory')
parser['invsub'] = parser['inventory'].add_subparsers(
title="Inventory commands", dest="subcommand")

View file

@ -11,8 +11,7 @@ SYNOPSIS
::
cdist [-h] [-l LOGLEVEL] [-q] [-v] [-V]
{banner,config,install,inventory,shell} ...
cdist [-h] [-V] {banner,config,install,inventory,shell} ...
cdist banner [-h] [-l LOGLEVEL] [-q] [-v]
@ -32,9 +31,7 @@ SYNOPSIS
[-A] [-a] [-f HOSTFILE] [-p [HOST_MAX]] [-S] [-s] [-t]
[host [host ...]]
cdist inventory [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-g CONFIG_FILE]
[-I INVENTORY_DIR]
{add-host,add-tag,del-host,del-tag,list} ...
cdist inventory [-h] {add-host,add-tag,del-host,del-tag,list} ...
cdist inventory add-host [-h] [-l LOGLEVEL] [-q] [-v] [-b]
[-g CONFIG_FILE] [-I INVENTORY_DIR]