You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expand all lines: PYTHON APPS/CLI-Based-TODO/task.py
+37-33
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,44 @@
1
-
importtime,os,sys
1
+
#!/usr/bin/env python3
2
+
importsys
3
+
fromargparseimportArgumentParserasaparse
2
4
3
5
usage="Usage :-\n$ ./task add 2 'hello world' # Add a new item with priority 2 and text \"hello world\" to the list\n$ ./task ls # Show incomplete priority list items sorted by priority in ascending order\n$ ./task del INDEX # Delete the incomplete item with the given index\n$ ./task done INDEX # Mark the incomplete item with the given index as complete\n$ ./task help # Show usage\n$ ./task report # Statistics ( list complete/incomplete task )"
4
6
5
-
deffunc():
6
-
try:
7
-
8
-
# printing help
9
-
ifsys.argv[1]=="help":
10
-
print(usage)
11
-
returnusage
7
+
defcreate_parser():
8
+
parser=aparse(description="""Command Line task list""")
0 commit comments