File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 20
20
"arguments" : [
21
21
{"name" : "--debug" , "action" : "store_true" , "help" : "use debug mode" },
22
22
{"name" : ["-n" , "--name" ], "help" : "use the given commitizen" },
23
+ {
24
+ "name" : ["--version" ],
25
+ "action" : "store_true" ,
26
+ "help" : "get the version of the installed commitizen" ,
27
+ },
23
28
],
24
29
"subcommands" : {
25
30
"title" : "commands" ,
26
- "required" : True ,
31
+ # TODO: Add this constraint back in 2.0
32
+ # "required": True,
27
33
"commands" : [
28
34
{
29
35
"name" : "ls" ,
@@ -123,11 +129,22 @@ def main():
123
129
if args .name :
124
130
conf .update ({"name" : args .name })
125
131
132
+ if args .version :
133
+ warnings .warn (
134
+ "'cz --version' will be deprecated in next major version. "
135
+ "Please use 'cz version' command from your scripts"
136
+ )
137
+ logging .getLogger ("commitizen" ).setLevel (logging .DEBUG )
138
+
126
139
if args .debug :
127
140
warnings .warn (
128
141
"Debug will be deprecated in next major version. "
129
142
"Please remove it from your scripts"
130
143
)
131
144
logging .getLogger ("commitizen" ).setLevel (logging .DEBUG )
132
145
133
- args .func (conf , vars (args ))()
146
+ # TODO: This try block can be removed after command is required in 2.0
147
+ try :
148
+ args .func (conf , vars (args ))()
149
+ except AttributeError :
150
+ out .error ("Command is required" )
You can’t perform that action at this time.
0 commit comments