Skip to content

Commit 7c05396

Browse files
authored
todo_completion: FIX: Add completion for missing done and deduplicate built-in actions
Merge pull request #484 from inkarkat/fix-completion-missing
2 parents 08c5b5d + 889ac12 commit 7c05396

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

tests/completion-test-lib.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
readonly ACTIONS='add a addto addm append app archive command del rm deduplicate depri dp do done help list ls listaddons listall lsa listcon lsc listfile lf listpri lsp listproj lsprj move mv prepend prep pri p replace report shorthelp'
4+
readonly OPTIONS='-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x'

tests/t6000-completion.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ test_description='Bash completion functionality
44
55
This test checks basic todo_completion of actions and options
66
'
7+
. ./completion-test-lib.sh
78
. ./test-lib.sh
89

9-
readonly ACTIONS='add a addto addm append app archive command del rm depri dp do help list ls listaddons listall lsa listcon lsc listfile lf listpri lsp listproj lsprj move mv prepend prep pri p replace report shorthelp'
10-
readonly OPTIONS='-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x'
11-
1210
test_todo_completion 'all arguments' 'todo.sh ' "$ACTIONS $OPTIONS"
1311
test_todo_completion 'arguments beginning with a' 'todo.sh a' 'add a addto addm append app archive'
1412
test_todo_completion 'all options' 'todo.sh -' "$OPTIONS"

tests/t6050-completion-addons.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ test_description='Bash add-on action completion functionality
44
55
This test checks todo_completion of custom actions in .todo.actions.d
66
'
7+
. ./completion-test-lib.sh
78
. ./test-lib.sh
89

9-
readonly ACTIONS='add a addto addm append app archive command del rm depri dp do help list ls listaddons listall lsa listcon lsc listfile lf listpri lsp listproj lsprj move mv prepend prep pri p replace report shorthelp'
10-
readonly OPTIONS='-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x'
11-
1210
readonly ADDONS='bar baz foobar'
1311

1412
readonly CONTAINED='xeno zoolander'

tests/t6100-completion-help.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ test_description='Bash help completion functionality
55
This test checks todo_completion of actions for usage help.
66
'
77
. ./actions-test-lib.sh
8+
. ./completion-test-lib.sh
89
. ./test-lib.sh
10+
911
make_action "zany"
1012
make_action "aardvark"
11-
12-
readonly ACTIONS='add a addto addm append app archive command del rm depri dp do help list ls listaddons listall lsa listcon lsc listfile lf listpri lsp listproj lsprj move mv prepend prep pri p replace report shorthelp'
1313
readonly ADDONS='aardvark zany'
1414

1515
test_todo_completion 'all actions after help' 'todo.sh help ' "$ACTIONS $ADDONS"

todo_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _todo()
1313
local -r OPTS="-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x"
1414
local -r COMMANDS="\
1515
add a addto addm append app archive command del \
16-
rm depri dp do help list ls listaddons listall lsa listcon \
16+
rm deduplicate depri dp do done help list ls listaddons listall lsa listcon \
1717
lsc listfile lf listpri lsp listproj lsprj move \
1818
mv prepend prep pri p replace report shorthelp"
1919
local -r MOVE_COMMAND_PATTERN='move|mv'

0 commit comments

Comments
 (0)