comparison piecrust/commands/builtin/themes.py @ 765:549e21789ad9

themes: No parameters shoudl make the help text show up. This makes the `themes` command consistent with other commands with sub-commands.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 02 Jul 2016 01:24:39 -0700
parents 5336e146ac8d
children 58ae026b4c31
comparison
equal deleted inserted replaced
764:f7ddd730c08d 765:549e21789ad9
51 def checkedRun(self, ctx): 51 def checkedRun(self, ctx):
52 if ctx.app.root_dir is None: 52 if ctx.app.root_dir is None:
53 raise SiteNotFoundError(theme=ctx.app.theme_site) 53 raise SiteNotFoundError(theme=ctx.app.theme_site)
54 54
55 if not hasattr(ctx.args, 'sub_func'): 55 if not hasattr(ctx.args, 'sub_func'):
56 ctx.args = ctx.parser.parse_args(['themes', 'info']) 56 ctx.parser.parse_args(['themes', '--help'])
57 return
57 ctx.args.sub_func(ctx) 58 ctx.args.sub_func(ctx)
58 59
59 def _info(self, ctx): 60 def _info(self, ctx):
60 theme_dir = ctx.app.theme_dir 61 theme_dir = ctx.app.theme_dir
61 if not os.path.exists(theme_dir): 62 if not os.path.exists(theme_dir):