Commits

Travis Shirk  committed d698e83

Added

  • Participants
  • Parent commits 0ffdf9d
  • Branches stable

Comments (0)

Files changed (1)

File etc/eyeD3.bash

+# bash-completion for 'eyeD3'
+
+unset __EYED3_COMPLETION_LONG_OPT
+
+function _eyeD3_completion()
+{
+    [[ -e `which eyeD3 2> /dev/null` ]] || return 0
+
+    # Variables to hold the current word and possible matches
+    local cur="${COMP_WORDS[COMP_CWORD]}"
+    local opts=()
+
+    case "${cur}" in
+        -*)
+            if [[ -z "${__EYED3_COMPLETION_LONG_OPT}" ]]; then
+                export __EYED3_COMPLETION_LONG_OPT=$(
+                    eyeD3 --help | egrep -o " \-[A-Za-z0-9_\-]+\=?" | sort -u)
+            fi
+            opts="${__EYED3_COMPLETION_LONG_OPT}"
+            ;;
+
+        *)
+            ;;
+    esac
+
+    # Set possible completions
+    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+}
+
+complete -o default -o nospace  -F _eyeD3_completion eyeD3