due: Add command line calls for 'add' and usage
This commit is contained in:
parent
0a3981c226
commit
51774b4004
11
due.py
11
due.py
@ -71,10 +71,21 @@ def due(search_term="", relative=False):
|
|||||||
print(i.fancy_print(relative))
|
print(i.fancy_print(relative))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
if sys.argv[1] == "usage":
|
||||||
|
print(" due [-r] [TERM...]\n"
|
||||||
|
" Shows all items with a t: or due: tag that match TERM. '-r' makes dates relative\n"
|
||||||
|
" due add [due date] [tag] [description]\n"
|
||||||
|
" Adds a task with a dated tag")
|
||||||
|
|
||||||
|
exit(0)
|
||||||
|
|
||||||
if len(sys.argv) >= 3:
|
if len(sys.argv) >= 3:
|
||||||
if sys.argv[2] == "-r":
|
if sys.argv[2] == "-r":
|
||||||
relative = True
|
relative = True
|
||||||
del sys.argv[2]
|
del sys.argv[2]
|
||||||
|
elif sys.argv[2] == "add":
|
||||||
|
add(sys.argv[3], sys.argv[4], " ".join(sys.argv[5:]))
|
||||||
|
exit(0)
|
||||||
else:
|
else:
|
||||||
relative = False
|
relative = False
|
||||||
search_term = " ".join(sys.argv[2:])
|
search_term = " ".join(sys.argv[2:])
|
||||||
|
Loading…
Reference in New Issue
Block a user