Make it show help for all arguments, not only the first two..
This commit is contained in:
@ -438,7 +438,7 @@ def main():
|
|||||||
|
|
||||||
config = configparser.ConfigParser()
|
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('-c', '--config', help='config file to load')
|
||||||
parser.add_argument('-d', '--debug', action='store_true', help='enable debug')
|
parser.add_argument('-d', '--debug', action='store_true', help='enable debug')
|
||||||
|
|
||||||
@ -495,9 +495,20 @@ def main():
|
|||||||
help='Location for queue dumps',
|
help='Location for queue dumps',
|
||||||
default=config[config_section]['var_dir'])
|
default=config[config_section]['var_dir'])
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'-h',
|
||||||
|
'--help',
|
||||||
|
help='show this help and exit',
|
||||||
|
action='store_true',
|
||||||
|
default=False
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
logging.debug(args)
|
logging.debug(args)
|
||||||
|
|
||||||
|
if args.help:
|
||||||
|
parser.print_help()
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
#Just quit early if file is missing..
|
#Just quit early if file is missing..
|
||||||
if os.path.isfile(args.file_to_follow) is False:
|
if os.path.isfile(args.file_to_follow) is False:
|
||||||
logging.error('Could not find log file %s', args.file_to_follow)
|
logging.error('Could not find log file %s', args.file_to_follow)
|
||||||
|
|||||||
Reference in New Issue
Block a user