And the same thing for _client.py
This commit is contained in:
@ -311,7 +311,7 @@ def main():
|
||||
config_section = 'client'
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
parser = argparse.ArgumentParser(exit_on_error=False)
|
||||
parser = argparse.ArgumentParser(exit_on_error=False, add_help=False)
|
||||
|
||||
parser.add_argument('-c', '--config', help='config file to load')
|
||||
parser.add_argument('-d', '--debug', action='store_true', help='enable debug')
|
||||
@ -343,7 +343,6 @@ def main():
|
||||
logging.error('No config file found')
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
'-r',
|
||||
'--host',
|
||||
@ -369,10 +368,20 @@ def main():
|
||||
dest='passwd_file',
|
||||
help='password file',
|
||||
default=config[config_section]['passwd_file'])
|
||||
parser.add_argument(
|
||||
'-h',
|
||||
'--help',
|
||||
help='show this help and exit',
|
||||
action='store_true',
|
||||
default=False)
|
||||
|
||||
args = parser.parse_args()
|
||||
logging.debug(args)
|
||||
|
||||
if args.help:
|
||||
parser.print_help()
|
||||
sys.exit()
|
||||
|
||||
#Make sure the file specified is to be found..
|
||||
if not os.path.isfile(args.passwd_file):
|
||||
logging.error('Cannot find passwd-file %s', args.passwd_file)
|
||||
|
||||
Reference in New Issue
Block a user