summaryrefslogtreecommitdiffstats
path: root/sbin/sunhpc-completion-backup
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/sunhpc-completion-backup')
-rw-r--r--sbin/sunhpc-completion-backup49
1 files changed, 0 insertions, 49 deletions
diff --git a/sbin/sunhpc-completion-backup b/sbin/sunhpc-completion-backup
deleted file mode 100644
index 8eb4f1e..0000000
--- a/sbin/sunhpc-completion-backup
+++ /dev/null
@@ -1,49 +0,0 @@
-# sunhpc(1) completion
-
-_sunhpc_array_delete_at()
-{
- eval "local ARRAY=(\"\${$1[@]}\")"
- local i
- local tmp=()
- local lower=$2
- local upper=${3:-$lower}
-
- for i in "${!ARRAY[@]}"; do
- if [[ "$i" -lt "$2" || "$i" -gt "${3-$2}" ]]; then
- tmp=("${tmp[@]}" "${ARRAY[$i]}")
- fi
- done
- eval "$1=(\"\${tmp[@]}\")"
-}
-
-_sunhpc()
-{
- local cur prev words cword i output
- _init_completion || return
-
- _sunhpc_array_delete_at words $((cword+1)) ${#words[@]}
- _sunhpc_array_delete_at words 0
-
- for i in ${!words[@]}; do
- words[i]="$(printf '%s' "${words[i]}" | xargs printf '%s\n' 2>/dev/null || true)"
- done
-
- if [[ "$cur" =~ ^[[:space:]]+ ]]; then
- cur=''
- fi
-
- output="$(sunhpc report completion ${words[@]} 2>/dev/null)"
-
- if [ $? = 65 ]; then
- compopt -o default
- COMPREPLY=()
- return 0
- fi
-
- local IFS=$'\n'
- COMPREPLY=( $( compgen -W '$output' -- $cur ) )
-
-} &&
-complete -F _sunhpc sunhpc
-
-# ex: ts=4 sw=4 et filetype=sh