Mercurial > piecrust2
diff piecrust/main.py @ 61:64f37c4cce68
Print the help by default when running `chef` with no command.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 27 Aug 2014 10:23:32 -0700 |
parents | c8c522dacfea |
children | cb1ed436642c |
line wrap: on
line diff
--- a/piecrust/main.py Tue Aug 26 23:20:48 2014 -0700 +++ b/piecrust/main.py Wed Aug 27 10:23:32 2014 -0700 @@ -179,6 +179,11 @@ result = parser.parse_args() logger.debug(format_timed(start_time, 'initialized PieCrust', colored=False)) + # Print the help if no command was specified. + if not hasattr(result, 'func'): + parser.print_help() + return 0 + # Run the command! ctx = CommandContext(app, parser, result) exit_code = result.func(ctx)