Skip to content

Commit

Permalink
adding default help for CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed May 16, 2018
1 parent 40d4d2b commit ae2bfb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_main.py
Expand Up @@ -187,3 +187,8 @@ def test_raw_cli(self):
with self.assertRaises(SystemExit) as context:
__main__.main()
self.assertRegexpMatches(context.Exception, 'usage: wc_kb')

with mock.patch('sys.argv', ['wc_kb']):
with CaptureOutput() as capturer:
__main__.main()
self.assertRegexpMatches(capturer.get_text(), 'usage: wc_kb')
4 changes: 4 additions & 0 deletions wc_kb/__main__.py
Expand Up @@ -23,6 +23,10 @@ class Meta:
(['-v', '--version'], dict(action='version', version=wc_kb.__version__)),
]

@expose(hide=True)
def default(self):
self.app.args.print_help()


class ValidateController(CementBaseController):
""" Validate knowledge base and display errors """
Expand Down

0 comments on commit ae2bfb6

Please sign in to comment.