]> git.pld-linux.org Git - packages/dic.git/commitdiff
- initial
authorZsolt Udvari <uzsolt@pld-linux.org>
Fri, 7 Aug 2009 18:42:24 +0000 (18:42 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dic-bash-completion -> 1.1

dic-bash-completion [new file with mode: 0644]

diff --git a/dic-bash-completion b/dic-bash-completion
new file mode 100644 (file)
index 0000000..c6fb2a9
--- /dev/null
@@ -0,0 +1,29 @@
+# dic bash_completition - made by uzsolt
+
+_dic() 
+{
+       local cur
+
+       COMPREPLY=()
+        prev=${COMP_WORDS[COMP_CWORD-1]}
+        cur=${COMP_WORDS[COMP_CWORD]}
+        if [ ${prev} = "show" -o ${prev} = "update" -o ${prev} = "remove" -o ${prev} = "view" ]; then
+            COMPREPLY=( $( compgen -W "$(dic list | cut --byte 1-21 | sed -n "3,$ p" | sed "s@ *\$@@ ; s@\ @\\\ @g")" -- $cur ) )
+        elif [ ${prev} = "search" -o ${prev} = "list" -o ${prev} = "add" ]; then
+            COMREPLY=""
+        else
+            case "$cur" in
+                -*)
+                    COMPREPLY=( $( compgen -W '-h --help -i --case-sensitive -d --device -r --regexp\
+                        -l --long -g --get -c --category -s --status -m --mode' -- $cur ) )
+                    ;;
+                *)
+                    COMPREPLY=( $( compgen -W 'add search remove get show list update view' -- $cur ) )
+                    ;;
+            esac
+        fi
+  
+       return 0
+
+}
+complete -F _dic dic
This page took 0.395624 seconds and 4 git commands to generate.