Add archive and unarch commands

This commit is contained in:
Nikolay Puzanov
2015-10-15 13:14:02 +03:00
parent d0bd48b0a1
commit 2bf8890d96
5 changed files with 178 additions and 64 deletions

View File

@@ -1,16 +1,16 @@
_timer()
{
local uncomplete=${COMP_WORDS[COMP_CWORD]}
case "$COMP_CWORD" in
1)
# Commands
COMPREPLY=( $(compgen -W "start stop report deadline refresh timesheet help" -- $uncomplete) )
COMPREPLY=( $(compgen -W "start stop report deadline archive unarch refresh timesheet help" -- $uncomplete) )
;;
2)
# Command argument 1
case "${COMP_WORDS[1]}" in
start)
start|archive)
local tasklist=$(timer tasklist)
COMPREPLY=( $(compgen -W "$tasklist" -- $uncomplete))
;;
@@ -22,6 +22,10 @@ _timer()
local deadlist=$(timer deadlist)
COMPREPLY=( $(compgen -W "set clear all $deadlist" -- $uncomplete))
;;
unarch)
local archlist=$(timer archlist)
COMPREPLY=( $(compgen -W "$archlist" -- $uncomplete))
;;
esac
;;
3)