Skip to content

Commit 261e8d7

Browse files
committed
completion/notify-send: shellcheck
1 parent d6fd70f commit 261e8d7

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

clean_files.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ completion/available/minikube.completion.bash
7979
completion/available/minishift.completion.bash
8080
completion/available/ng.completion.bash
8181
completion/available/ngrok.completion.bash
82-
#completion/available/notify-send.completion.bash
82+
completion/available/notify-send.completion.bash
8383
completion/available/npm.completion.bash
8484
completion/available/nvm.completion.bash
8585
completion/available/openshift.completion.bash
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
# shellcheck shell=bash
22

3-
function __notify-send_completions() {
4-
# shellcheck disable=SC2155
5-
local curr=$(_get_cword)
6-
# shellcheck disable=SC2155
7-
local prev=$(_get_pword)
3+
# Make sure notify-send is installed
4+
_bash-it-completion-helper-necessary notify-send || :
5+
6+
# Don't handle completion if it's already managed
7+
_bash-it-completion-helper-sufficient notify-send || return
8+
9+
function _notify-send() {
10+
local prev="${COMP_WORDS[COMP_CWORD - 1]}"
811

912
case $prev in
1013
-u | --urgency)
11-
# shellcheck disable=SC2207
12-
COMPREPLY=($(compgen -W "low normal critical" -- "$curr"))
14+
COMPREPLY=("low" "normal" "critical")
1315
;;
1416
*)
15-
# shellcheck disable=SC2207
16-
COMPREPLY=($(compgen -W "-? --help -u --urgency -t --expire-time -a --app-name -i --icon -c --category -h --hint -v --version" -- "$curr"))
17+
COMPREPLY=("-?" "--help" "-u" "--urgency" "-t" "--expire-time" "-a" "--app-name" "-i" "--icon" "-c" "--category" "-h" "--hint" "-v" "--version")
1718
;;
1819
esac
1920
}
2021

21-
complete -F __notify-send_completions notify-send
22+
complete -F _notify-send -X '!&*' notify-send

0 commit comments

Comments
 (0)