##// END OF EJS Templates
Moved print description and examples into default help output...
Jonathan Frederic -
Show More
@@ -88,9 +88,7 b' def catch_config_error(method, app, *args, **kwargs):'
88 try:
88 try:
89 return method(app, *args, **kwargs)
89 return method(app, *args, **kwargs)
90 except (TraitError, ArgumentError) as e:
90 except (TraitError, ArgumentError) as e:
91 app.print_description()
92 app.print_help()
91 app.print_help()
93 app.print_examples()
94 app.log.fatal("Bad config encountered during initialization:")
92 app.log.fatal("Bad config encountered during initialization:")
95 app.log.fatal(str(e))
93 app.log.fatal(str(e))
96 app.log.debug("Config at the time: %s", app.config)
94 app.log.debug("Config at the time: %s", app.config)
@@ -337,6 +335,7 b' class Application(SingletonConfigurable):'
337
335
338 If classes=False (the default), only flags and aliases are printed.
336 If classes=False (the default), only flags and aliases are printed.
339 """
337 """
338 self.print_description()
340 self.print_subcommands()
339 self.print_subcommands()
341 self.print_options()
340 self.print_options()
342
341
@@ -356,6 +355,9 b' class Application(SingletonConfigurable):'
356 print "To see all available configurables, use `--help-all`"
355 print "To see all available configurables, use `--help-all`"
357 print
356 print
358
357
358 self.print_examples()
359
360
359 def print_description(self):
361 def print_description(self):
360 """Print the application description."""
362 """Print the application description."""
361 for p in wrap_paragraphs(self.description):
363 for p in wrap_paragraphs(self.description):
@@ -475,9 +477,7 b' class Application(SingletonConfigurable):'
475 interpreted_argv = argv
477 interpreted_argv = argv
476
478
477 if any(x in interpreted_argv for x in ('-h', '--help-all', '--help')):
479 if any(x in interpreted_argv for x in ('-h', '--help-all', '--help')):
478 self.print_description()
479 self.print_help('--help-all' in interpreted_argv)
480 self.print_help('--help-all' in interpreted_argv)
480 self.print_examples()
481 self.exit(0)
481 self.exit(0)
482
482
483 if '--version' in interpreted_argv or '-V' in interpreted_argv:
483 if '--version' in interpreted_argv or '-V' in interpreted_argv:
@@ -215,7 +215,7 b' class NbConvertApp(BaseIPythonApplication):'
215
215
216 # No notebooks were specified, show help.
216 # No notebooks were specified, show help.
217 if len(self.notebooks) == 0:
217 if len(self.notebooks) == 0:
218 self.print_examples()
218 self.print_help()
219
219
220 # Show how to access help.
220 # Show how to access help.
221 print('For help, use "ipython nbconvert --help"')
221 print('For help, use "ipython nbconvert --help"')
General Comments 0
You need to be logged in to leave comments. Login now