-#!/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]}"
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"
opts="-c -v -q -b -i -I -e -w"
lopts="--create-metadata --verbose --quiet --buildreport
--interactive --icons --editor --wiki --pretty --clean --delete-unknown
- --nosign"
+ --nosign --rename-apks --use-date-from-apk"
case "${prev}" in
-e|--editor)
_filedir
esac
}
+__complete_btlog() {
+ opts="-u"
+ lopts="--git-remote --git-repo --url"
+ __complete_options
+}
+
__complete_stats() {
opts="-v -q -d"
lopts="--verbose --quiet --download"
__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"
__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 \
+publish \
+readmeta \
+rewritemeta \
+scanner \
+server \
+signatures \
+signindex \
+stats \
+update \
+verify \
+"
for c in $__cmds; do
eval "_fdroid_${c} () {