]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
- updated, added lintpkg completion
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 9 Jun 2011 19:14:36 +0000 (19:14 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Thu, 9 Jun 2011 19:14:36 +0000 (19:14 +0000)
Changed files:
    shell/bash-completion.sh -> 1.6

shell/bash-completion.sh

index ce19974891b7a2edb58d8244271503e6c843ccb4..ca05c32a04aef9fa22d2e7a47fedbcda1bf45285 100644 (file)
@@ -1,10 +1,6 @@
 # various completions for pld-ftp-admin tools
 # Author: Elan Ruusamäe <glen@pld-linux.org>
 
-have pfa-genindex || return
-have pfa-lintpkg || return
-have pfa-mvpkg || return
-
 # return list of pld ftp trees
 _pfa_tree() {
     local cur="$1"
@@ -37,6 +33,7 @@ _pfa_tree_files() {
     done
 }
 
+have pfa-genindex &&
 _pfa-genindex()
 {
     local cur
@@ -57,7 +54,32 @@ _pfa-genindex()
 } &&
 complete -F _pfa-genindex pfa-genindex
 
+have pfa-lintpkg &&
 _pfa-lintpkg()
+{
+    local cur arg
+
+    COMPREPLY=()
+    _get_comp_words_by_ref cur
+
+    if [[ "$cur" == -* ]]; then
+        COMPREPLY=( $( compgen -W '-q -s --quiet' -- "$cur" ) )
+    else
+        # The first argument is an tree; the rest are files in a dir
+        _count_args :
+
+        if [[ $args == 1 ]]; then
+            _pfa_tree "$cur"
+        else
+            _get_first_arg
+            _pfa_tree_files "$arg" "$cur"
+        fi
+    fi
+} &&
+complete -F _pfa-lintpkg pfa-lintpkg
+
+have pfa-signpkg &&
+_pfa-signpkg()
 {
     local cur
 
@@ -73,8 +95,9 @@ _pfa-lintpkg()
         _pfa_tree_files "${COMP_WORDS[1]}" "$cur"
     fi
 } &&
-complete -F _pfa-lintpkg pfa-lintpkg pfa-signpkg pfa-rmpkg
+complete -F _pfa-signpkg pfa-signpkg pfa-rmpkg
 
+have pfa-mvpkg &&
 _pfa-mvpkg()
 {
     local cur
This page took 0.047265 seconds and 4 git commands to generate.