Help command

master
Lertsenem 2015-08-09 14:21:46 +02:00
parent e43ebf8f0b
commit 03ae84e81e
1 changed files with 6 additions and 1 deletions

View File

@ -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")
subparsers = parser.add_subparsers( dest="command", title="commands", description="Valid commands" )
subparsers = parser.add_subparsers( dest="command", title="commands") #, description="Valid commands" )
# Help
parser_help = subparsers.add_parser("help", help="Print this help")
@ -58,6 +58,11 @@ args = parser.parse_args()
if(args.verbose):
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
if(not os.path.isdir(args.rootdir)):