chiark / gitweb /
remove fd-commit, no active devs use it, and requires Auto Name/Name
[fdroidserver.git] / completion / bash-completion
index f2632d676baf797e55bd082f87a54d5667a00b86..1a5ac52362bbb63297d720b00a2b1485bd9348c9 100644 (file)
@@ -1,8 +1,8 @@
-#!/bin/bash
+# fdroid(1) completion                                   -*- shell-script -*-
 #
 # bash-completion - part of the FDroid server tools
-# Bash completion for the fdroid main tools
 #
+# Copyright (C) 2013-2017 Hans-Christoph Steiner <hans@eds.org>
 # Copyright (C) 2013, 2014 Daniel Martí <mvdan@mvdan.cc>
 #
 # This program is free software: you can redistribute it and/or modify
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# 'fdroid' is completed automatically, but aliases to it are not.
-# For instance, to alias 'fd' to 'fdroid' and have competion available:
-#
-#      alias fd='fdroid'
-#      complete -F _fdroid fd
-#
-# One can use completion on aliased subcommands as follows:
-#
-#      alias fbuild='fdroid build'
-#      complete -F _fdroid_build fbuild
-
 __fdroid_init() {
        COMPREPLY=()
        cur="${COMP_WORDS[COMP_CWORD]}"
@@ -116,6 +105,28 @@ __complete_build() {
        esac
 }
 
+__complete_dscanner() {
+       opts="-v -q -l"
+       lopts="--verbose --quiet --clean-after --clean-before --clean-only --init-only --latest --repo-path"
+        case "${cur}" in
+               -*)
+                       __complete_options
+                       return 0;;
+               *:)
+                       __vercode
+                       return 0;;
+               *)
+                       __package
+                       return 0;;
+       esac
+}
+
+__complete_gpgsign() {
+       opts="-v -q"
+       lopts="--verbose --quiet"
+       __complete_options
+}
+
 __complete_install() {
        opts="-v -q"
        lopts="--verbose --quiet --all"
@@ -136,7 +147,7 @@ __complete_update() {
        opts="-c -v -q -b -i -I -e -w"
        lopts="--create-metadata --verbose --quiet --buildreport
  --interactive --icons --editor --wiki --pretty --clean --delete-unknown
- --nosign --use-date-from-apk"
+ --nosign --rename-apks --use-date-from-apk"
        case "${prev}" in
                -e|--editor)
                        _filedir
@@ -247,6 +258,24 @@ __complete_verify() {
        esac
 }
 
+__complete_btlog() {
+       opts="-u"
+       lopts="--git-remote --git-repo --url"
+       __complete_options
+}
+
+__complete_mirror() {
+       opts="-v"
+       lopts="--archive --output-dir"
+       __complete_options
+}
+
+__complete_nightly() {
+       opts="-v -q"
+       lopts="--show-secret-var"
+       __complete_options
+}
+
 __complete_stats() {
        opts="-v -q -d"
        lopts="--verbose --quiet --download"
@@ -260,6 +289,16 @@ __complete_server() {
        __complete_options
 }
 
+__complete_signatures() {
+       opts="-v -q"
+       lopts="--verbose --no-check-https"
+       case "${cur}" in
+               -*)
+                       __complete_options
+                       return 0;;
+       esac
+}
+
 __complete_signindex() {
        opts="-v -q"
        lopts="--verbose"
@@ -273,8 +312,29 @@ __complete_init() {
        __complete_options
 }
 
-__cmds=" build init install update publish checkupdates import readmeta \
-rewritemeta lint scanner verify stats server signindex "
+__cmds=" \
+btlog \
+build \
+checkupdates \
+dscanner \
+gpgsign \
+import \
+init \
+install \
+lint \
+mirror \
+nightly \
+publish \
+readmeta \
+rewritemeta \
+scanner \
+server \
+signatures \
+signindex \
+stats \
+update \
+verify \
+"
 
 for c in $__cmds; do
        eval "_fdroid_${c} () {
@@ -292,11 +352,6 @@ _fdroid() {
        }
 }
 
-_fd-commit() {
-       __package
-}
-
 complete -F _fdroid fdroid
-complete -F _fd-commit fd-commit
 
 return 0