Help command
parent
e43ebf8f0b
commit
03ae84e81e
|
@ -37,7 +37,7 @@ parser.add_argument( "--rootdir", type=str, help="The persoconf directory to use
|
||||||
parser.add_argument( '--verbose', help='Spout out more logs', action="store_true")
|
parser.add_argument( '--verbose', help='Spout out more logs', action="store_true")
|
||||||
|
|
||||||
|
|
||||||
subparsers = parser.add_subparsers( dest="command", title="commands", description="Valid commands" )
|
subparsers = parser.add_subparsers( dest="command", title="commands") #, description="Valid commands" )
|
||||||
|
|
||||||
# Help
|
# Help
|
||||||
parser_help = subparsers.add_parser("help", help="Print this help")
|
parser_help = subparsers.add_parser("help", help="Print this help")
|
||||||
|
@ -58,6 +58,11 @@ args = parser.parse_args()
|
||||||
if(args.verbose):
|
if(args.verbose):
|
||||||
logging.bascConfig(level=logging.DEBUG)
|
logging.bascConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
|
# If we were asked for help, let's give some
|
||||||
|
if args.command in [ "help", None ]:
|
||||||
|
parser.print_help()
|
||||||
|
exit()
|
||||||
|
|
||||||
# Let's check that the rootdir exists
|
# Let's check that the rootdir exists
|
||||||
if(not os.path.isdir(args.rootdir)):
|
if(not os.path.isdir(args.rootdir)):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue