Skip to content

Commit d5dc617

Browse files
committed
fix(cli): handle the exception that command is not given
1 parent b94bc6b commit d5dc617

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

commitizen/cli.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from decli import cli
77

8-
from commitizen import commands, config
8+
from commitizen import commands, config, out
99

1010

1111
logger = logging.getLogger(__name__)
@@ -114,7 +114,11 @@ def main():
114114
parser.print_help(sys.stderr)
115115
raise SystemExit()
116116

117-
args = parser.parse_args()
117+
try:
118+
args = parser.parse_args()
119+
except TypeError:
120+
out.error("Command is required")
121+
raise SystemExit()
118122

119123
if args.name:
120124
conf.update({"name": args.name})

0 commit comments

Comments
 (0)