Skip to content

Commit d7ff4f3

Browse files
committed
Include new ls and rm commands in bash completion
1 parent 9586aa3 commit d7ff4f3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

notes.bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ _notes_complete_notes() {
1616
}
1717

1818
_notes_complete_commands() {
19-
local valid_commands="new find grep open"
19+
local valid_commands="new find grep open ls rm"
2020
COMPREPLY=($(compgen -W "${valid_commands}" -- "${1}"))
2121
}
2222

test/test-bash-completion.bats

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ teardown() {
1717
@test "Should list all commands" {
1818
touch $NOTES_DIRECTORY/note1.md
1919
_notes_complete_commands ""
20-
assert_contains "new" ${COMPREPLY[@]}
21-
assert_contains "find" ${COMPREPLY[@]}
22-
assert_contains "grep" ${COMPREPLY[@]}
23-
assert_contains "open" ${COMPREPLY[@]}
20+
assert_contains "new" "${COMPREPLY[@]}"
21+
assert_contains "find" "${COMPREPLY[@]}"
22+
assert_contains "grep" "${COMPREPLY[@]}"
23+
assert_contains "open" "${COMPREPLY[@]}"
24+
assert_contains "ls" "${COMPREPLY[@]}"
25+
assert_contains "rm" "${COMPREPLY[@]}"
2426
}
2527

2628
@test "Should show matching note when found" {

0 commit comments

Comments
 (0)