comparison 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
comparison
equal deleted inserted replaced
60:6e60e0fef2be 61:64f37c4cce68
177 177
178 # Parse the command line. 178 # Parse the command line.
179 result = parser.parse_args() 179 result = parser.parse_args()
180 logger.debug(format_timed(start_time, 'initialized PieCrust', colored=False)) 180 logger.debug(format_timed(start_time, 'initialized PieCrust', colored=False))
181 181
182 # Print the help if no command was specified.
183 if not hasattr(result, 'func'):
184 parser.print_help()
185 return 0
186
182 # Run the command! 187 # Run the command!
183 ctx = CommandContext(app, parser, result) 188 ctx = CommandContext(app, parser, result)
184 exit_code = result.func(ctx) 189 exit_code = result.func(ctx)
185 return exit_code 190 return exit_code
186 191