forked from ungleich-public/cdist
fixup most arguments for config
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
df7f27f94b
commit
8d1b4236d4
1 changed files with 30 additions and 25 deletions
17
bin/cdist
17
bin/cdist
|
@ -598,15 +598,16 @@ class Cdist:
|
|||
self.deploy_to()
|
||||
self.cleanup()
|
||||
|
||||
def banner(*args):
|
||||
def banner(args):
|
||||
"""Guess what :-)"""
|
||||
print(BANNER)
|
||||
sys.exit(0)
|
||||
|
||||
def config(*args):
|
||||
def config(args):
|
||||
"""Configure remote system"""
|
||||
print(*args)
|
||||
print(args)
|
||||
process = {}
|
||||
|
||||
if len(args.host) == 0:
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
@ -637,7 +638,8 @@ if __name__ == "__main__":
|
|||
# Construct parser others can reuse
|
||||
parser = {}
|
||||
# Options _all_ parsers have in common
|
||||
parser['most'] = argparse.ArgumentParser(add_help=False)
|
||||
parser['most'] = argparse.ArgumentParser(add_help=False,
|
||||
epilog="Get cdist at http://www.nico.schottelius.org/software/cdist/")
|
||||
parser['most'].add_argument('-d', '--debug',
|
||||
help='Set log level to debug',
|
||||
action='store_true')
|
||||
|
@ -645,9 +647,12 @@ if __name__ == "__main__":
|
|||
help='Show version',
|
||||
action='version',
|
||||
version='%(prog)s ' + VERSION)
|
||||
#version='%(prog)s ' + VERSION)
|
||||
|
||||
|
||||
# Main subcommand parser
|
||||
parser['main'] = argparse.ArgumentParser(description='cdist ' + VERSION)
|
||||
parser['main'] = argparse.ArgumentParser(description='cdist ' + VERSION,
|
||||
parents=[parser['most']])
|
||||
parser['sub'] = parser['main'].add_subparsers()
|
||||
|
||||
parser['banner'] = parser['sub'].add_parser('banner')
|
||||
|
@ -656,7 +661,7 @@ if __name__ == "__main__":
|
|||
parser['config'] = parser['sub'].add_parser('config',
|
||||
aliases=['deploy'],
|
||||
parents=[parser['most']])
|
||||
parser['config'].add_argument('host', nargs='*',
|
||||
parser['config'].add_argument('host', nargs='+',
|
||||
help='one or more hosts to operate on')
|
||||
parser['config'].add_argument('-c', '--cdist-home',
|
||||
help='Change cdist home (default: .. from bin directory)',
|
||||
|
|
Loading…
Reference in a new issue