Merge pull request #16 from darko-poljak/no-args-err
Fix error when called without args.
This commit is contained in:
commit
bd0c3cc13c
1 changed files with 4 additions and 2 deletions
|
@ -92,8 +92,10 @@ def parse_argv(argv, version):
|
||||||
log.debug(args)
|
log.debug(args)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
args.func(args)
|
if hasattr(args, "func"):
|
||||||
|
args.func(args)
|
||||||
|
else:
|
||||||
|
parser['main'].print_help()
|
||||||
except ctt.Error as e:
|
except ctt.Error as e:
|
||||||
log.error(e)
|
log.error(e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
Loading…
Reference in a new issue