mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-05 22:08:27 +00:00
Merge pull request #532 from smira/530-bash-completion
Move bash completion to main aptly repo
This commit is contained in:
11
Makefile
11
Makefile
@@ -58,20 +58,11 @@ mem.png: mem.dat mem.gp
|
|||||||
gnuplot mem.gp
|
gnuplot mem.gp
|
||||||
open mem.png
|
open mem.png
|
||||||
|
|
||||||
src-package:
|
|
||||||
rm -rf aptly-$(VERSION)
|
|
||||||
mkdir -p aptly-$(VERSION)/src/github.com/smira/aptly/
|
|
||||||
cd aptly-$(VERSION)/src/github.com/smira/ && git clone https://github.com/smira/aptly && cd aptly && git checkout v$(VERSION)
|
|
||||||
mkdir -p aptly-$(VERSION)/bash_completion.d
|
|
||||||
(cd aptly-$(VERSION)/bash_completion.d && wget https://raw.github.com/aptly-dev/aptly-bash-completion/$(VERSION)/aptly)
|
|
||||||
tar cyf aptly-$(VERSION)-src.tar.bz2 aptly-$(VERSION)
|
|
||||||
rm -rf aptly-$(VERSION)
|
|
||||||
|
|
||||||
goxc:
|
goxc:
|
||||||
rm -rf root/
|
rm -rf root/
|
||||||
mkdir -p root/usr/share/man/man1/ root/etc/bash_completion.d
|
mkdir -p root/usr/share/man/man1/ root/etc/bash_completion.d
|
||||||
cp man/aptly.1 root/usr/share/man/man1
|
cp man/aptly.1 root/usr/share/man/man1
|
||||||
(cd root/etc/bash_completion.d && wget https://raw.github.com/aptly-dev/aptly-bash-completion/master/aptly)
|
cp bash_completion.d/aptly root/etc/bash_completion.d
|
||||||
gzip root/usr/share/man/man1/aptly.1
|
gzip root/usr/share/man/man1/aptly.1
|
||||||
goxc -pv=$(VERSION) -max-processors=4 $(GOXC_OPTS)
|
goxc -pv=$(VERSION) -max-processors=4 $(GOXC_OPTS)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Aptly is a swiss army knife for Debian repository management.
|
|||||||
.. image:: http://www.aptly.info/img/aptly_logo.png
|
.. image:: http://www.aptly.info/img/aptly_logo.png
|
||||||
:target: http://www.aptly.info/
|
:target: http://www.aptly.info/
|
||||||
|
|
||||||
Documentation is available at `http://www.aptly.info/ <http://www.aptly.info/>`_. For support use
|
Documentation is available at `http://www.aptly.info/ <http://www.aptly.info/>`_. For support please use
|
||||||
mailing list `aptly-discuss <https://groups.google.com/forum/#!forum/aptly-discuss>`_.
|
mailing list `aptly-discuss <https://groups.google.com/forum/#!forum/aptly-discuss>`_.
|
||||||
|
|
||||||
Aptly features: ("+" means planned features)
|
Aptly features: ("+" means planned features)
|
||||||
@@ -42,7 +42,7 @@ Current limitations:
|
|||||||
Download
|
Download
|
||||||
--------
|
--------
|
||||||
|
|
||||||
To install aptly on Debian/Ubuntu, add new repository to /etc/apt/sources.list::
|
To install aptly on Debian/Ubuntu, add new repository to ``/etc/apt/sources.list``::
|
||||||
|
|
||||||
deb http://repo.aptly.info/ squeeze main
|
deb http://repo.aptly.info/ squeeze main
|
||||||
|
|
||||||
|
|||||||
634
bash_completion.d/aptly
Normal file
634
bash_completion.d/aptly
Normal file
@@ -0,0 +1,634 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# (The MIT License)
|
||||||
|
#
|
||||||
|
# Copyright (c) 2014 Andrey Smirnov
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the 'Software'), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
|
|
||||||
|
__aptly_mirror_list()
|
||||||
|
{
|
||||||
|
aptly mirror list -raw
|
||||||
|
}
|
||||||
|
|
||||||
|
__aptly_repo_list()
|
||||||
|
{
|
||||||
|
aptly repo list -raw
|
||||||
|
}
|
||||||
|
|
||||||
|
__aptly_snapshot_list()
|
||||||
|
{
|
||||||
|
aptly snapshot list -raw
|
||||||
|
}
|
||||||
|
|
||||||
|
__aptly_published_distributions()
|
||||||
|
{
|
||||||
|
aptly publish list -raw | cut -d ' ' -f 2 | sort | uniq
|
||||||
|
}
|
||||||
|
|
||||||
|
__aptly_published_prefixes()
|
||||||
|
{
|
||||||
|
aptly publish list -raw | cut -d ' ' -f 1 | sort | uniq
|
||||||
|
}
|
||||||
|
|
||||||
|
__aptly_prefixes_for_distribution()
|
||||||
|
{
|
||||||
|
aptly publish list -raw | awk -v dist="$1" '{ if (dist == $2) print $1 }' | sort | uniq
|
||||||
|
}
|
||||||
|
|
||||||
|
_aptly()
|
||||||
|
{
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
commands="api config db graph mirror package publish repo serve snapshot task version"
|
||||||
|
options="-architectures= -config= -dep-follow-all-variants -dep-follow-recommends -dep-follow-source -dep-follow-suggests"
|
||||||
|
|
||||||
|
db_subcommands="cleanup recover"
|
||||||
|
mirror_subcommands="create drop show list rename search update"
|
||||||
|
publish_subcommands="drop list repo snapshot switch update"
|
||||||
|
snapshot_subcommands="create diff drop filter list merge pull rename search show verify"
|
||||||
|
repo_subcommands="add copy create drop edit import include list move remove rename search show"
|
||||||
|
package_subcommands="search show"
|
||||||
|
task_subcommands="run"
|
||||||
|
config_subcommands="show"
|
||||||
|
api_subcommands="serve"
|
||||||
|
|
||||||
|
local cmd subcmd numargs numoptions i
|
||||||
|
|
||||||
|
numargs=0
|
||||||
|
numoptions=0
|
||||||
|
|
||||||
|
for (( i=1; i < $COMP_CWORD; i++ )); do
|
||||||
|
if [[ -n "$cmd" ]]; then
|
||||||
|
if [[ ! -n "$subcmd" ]]; then
|
||||||
|
subcmd=${COMP_WORDS[i]}
|
||||||
|
numargs=$(( COMP_CWORD - i - 1 ))
|
||||||
|
else
|
||||||
|
if [[ "${COMP_WORDS[i]}" == -* ]]; then
|
||||||
|
numoptions=$(( numoptions + 1 ))
|
||||||
|
numargs=$(( numargs - 1 ))
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ ! "${COMP_WORDS[i]}" == -* ]]; then
|
||||||
|
cmd=${COMP_WORDS[i]}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ ! -n "$cmd" ]];
|
||||||
|
then
|
||||||
|
case "$cur" in
|
||||||
|
-*)
|
||||||
|
COMPREPLY=($(compgen -W "${options}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
COMPREPLY=($(compgen -W "${commands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -n "$subcmd" ]];
|
||||||
|
then
|
||||||
|
case "$prev" in
|
||||||
|
"db")
|
||||||
|
COMPREPLY=($(compgen -W "${db_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"mirror")
|
||||||
|
COMPREPLY=($(compgen -W "${mirror_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"repo")
|
||||||
|
COMPREPLY=($(compgen -W "${repo_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"snapshot")
|
||||||
|
COMPREPLY=($(compgen -W "${snapshot_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"publish")
|
||||||
|
COMPREPLY=($(compgen -W "${publish_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"package")
|
||||||
|
COMPREPLY=($(compgen -W "${package_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"task")
|
||||||
|
COMPREPLY=($(compgen -W "${task_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"config")
|
||||||
|
COMPREPLY=($(compgen -W "${config_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"api")
|
||||||
|
COMPREPLY=($(compgen -W "${api_subcommands}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$cmd" in
|
||||||
|
"mirror")
|
||||||
|
case "$subcmd" in
|
||||||
|
"create")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-filter= -filter-with-deps -force-components -ignore-signatures -keyring= -with-sources -with-udebs" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"edit")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-filter= -filter-with-deps -with-sources -with-udebs" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_mirror_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"show")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-with-packages" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_mirror_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"search")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-format= -with-deps" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_mirror_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"rename")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_mirror_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"drop")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-force" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_mirror_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"list")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-raw" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"update")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-force -download-limit= -ignore-checksums -ignore-signatures -keyring= -skip-existing-packages" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_mirror_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"repo")
|
||||||
|
case "$subcmd" in
|
||||||
|
"add")
|
||||||
|
case $numargs in
|
||||||
|
0)
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-force-replace -remove-files" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
_filedir '@(deb|dsc|udeb)'
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"copy"|"move")
|
||||||
|
case $numargs in
|
||||||
|
0)
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-with-deps -dry-run" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"create")
|
||||||
|
case $numargs in
|
||||||
|
0)
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-comment= -distribution= -component= -uploaders-file=" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
COMPREPLY=($(compgen -W "from" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
COMPREPLY=($(compgen -W "snapshot" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"drop")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-force" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"edit")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-comment= -distribution= -component= -uploaders-file=" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"search")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-format= -with-deps" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"list")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-raw" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"include")
|
||||||
|
case $numargs in
|
||||||
|
0)
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-accept-unsigned -force-replace -ignore-signatures -keyring= -no-remove-files -repo= -uploaders-file=" -- ${cur}))
|
||||||
|
else
|
||||||
|
comptopt -o filenames 2>/dev/null
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"import")
|
||||||
|
case $numargs in
|
||||||
|
0)
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-with-deps -dry-run" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_mirror_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"remove")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-dry-run" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"show")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-with-packages" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"rename")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"snapshot")
|
||||||
|
case "$subcmd" in
|
||||||
|
"create")
|
||||||
|
case $numargs in
|
||||||
|
1)
|
||||||
|
COMPREPLY=($(compgen -W "from empty" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
if [[ "$prev" == "from" ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "mirror repo" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
if [[ "$prev" == "mirror" ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_mirror_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
if [[ "$prev" == "repo" ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"diff")
|
||||||
|
if [[ $numargs -eq 0 ]] && [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-only-matching" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $numargs -lt 2 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"drop")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-force" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"list")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-raw -sort=" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"merge")
|
||||||
|
if [[ $numargs -gt 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-latest" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"pull")
|
||||||
|
if [[ $numargs -eq 0 ]] && [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-all-matches -dry-run -no-deps -no-remove" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $numargs -lt 2 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"filter")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-with-deps" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"show")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-with-packages" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"search")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-format= -with-deps" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"rename")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"verify")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"publish")
|
||||||
|
case "$subcmd" in
|
||||||
|
"snapshot"|"repo")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-batch -force-overwrite -distribution= -component= -gpg-key= -keyring= -label= -origin= -passphrase= -passphrase-file= -secret-keyring= -skip-contents -skip-signing" -- ${cur}))
|
||||||
|
else
|
||||||
|
if [[ "$subcmd" == "snapshot" ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_repo_list)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $numargs -eq 1 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_published_prefixes)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"list")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-raw" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"update")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-batch -force-overwrite -gpg-key= -keyring= -passphrase= -passphrase-file= -secret-keyring= -skip-contents -skip-signing" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_published_distributions)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $numargs -eq 1 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_prefixes_for_distribution $prev)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"switch")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-batch -force-overwrite -component= -gpg-key= -keyring= -passphrase= -passphrase-file= -secret-keyring= -skip-contents -skip-signing" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_published_distributions)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $numargs -eq 1 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_prefixes_for_distribution $prev)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $numargs -ge 2 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_snapshot_list)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"drop")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-force-drop" -- ${cur}))
|
||||||
|
else
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_published_distributions)" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $numargs -eq 1 ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "$(__aptly_prefixes_for_distribution $prev)" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"package")
|
||||||
|
case "$subcmd" in
|
||||||
|
"search")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-format=" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"show")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-with-files -with-references" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"serve")
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-listen=" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"graph")
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-format= -output=" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"api")
|
||||||
|
case "$subcmd" in
|
||||||
|
"serve")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-listen=" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
"db")
|
||||||
|
case "$subcmd" in
|
||||||
|
"cleanup")
|
||||||
|
if [[ $numargs -eq 0 ]]; then
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=($(compgen -W "-dry-run -verbose" -- ${cur}))
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
} && complete -F _aptly aptly
|
||||||
Reference in New Issue
Block a user