File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -139,13 +139,13 @@ def main_cli():
139
139
formatter_class = argparse .RawTextHelpFormatter ,
140
140
)
141
141
parser .add_argument (
142
- "-v" ,
143
142
"--version" ,
144
- action = "version " ,
145
- version = f"%(prog)s { __version__ } " ,
143
+ action = "store_true " ,
144
+ help = "Show program's version number and exit " ,
146
145
)
147
146
parser .add_argument (
148
147
"task" ,
148
+ nargs = "?" ,
149
149
type = str ,
150
150
help = "The task description string, or a file path prefixed with '@:' (e.g., '@:path/to/task.txt').\n "
151
151
'Example: taskgist "Create a new user authentication system"\n '
@@ -154,6 +154,13 @@ def main_cli():
154
154
155
155
args = parser .parse_args ()
156
156
157
+ if args .version :
158
+ print (f"{ parser .prog } { __version__ } " )
159
+ return
160
+
161
+ if args .task is None :
162
+ parser .error ("the following arguments are required: task" )
163
+
157
164
try :
158
165
task_description_content = get_task_description (args .task )
159
166
except FileNotFoundError as e :
You can’t perform that action at this time.
0 commit comments