From 83098ad13a244a5d64595750764b88dc4371bc71 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Tue, 13 Oct 2009 15:45:41 +0200 Subject: Better name for the bash completion script --- src/CLI/abrt-cli.bash | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/CLI/abrt-cli.bash (limited to 'src/CLI/abrt-cli.bash') diff --git a/src/CLI/abrt-cli.bash b/src/CLI/abrt-cli.bash new file mode 100644 index 0000000..089d5a3 --- /dev/null +++ b/src/CLI/abrt-cli.bash @@ -0,0 +1,34 @@ +# bash-completion add-on for abrt-cli(1) +# http://bash-completion.alioth.debian.org/ + +_abrt_cli() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="--help --version --get-list --get-list-full --report --report-always --delete" + + # + # Complete the arguments to some of the basic commands. + # + case "${prev}" in + --report|--report-always|--delete) + local uuids=$(abrt-cli --get-list | grep UUID | awk '{print $3}') + COMPREPLY=( $(compgen -W "${uuids}" -- ${cur}) ) + return 0 + ;; + esac + + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 +} +complete -F _abrt_cli abrt-cli + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh \ No newline at end of file -- cgit From f824969d3a8e77a41dac30997b47a0268cc01cbd Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 21 Oct 2009 15:49:01 +0200 Subject: fix warning and whitespace damage Signed-off-by: Denys Vlasenko --- src/CLI/abrt-cli.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/CLI/abrt-cli.bash') diff --git a/src/CLI/abrt-cli.bash b/src/CLI/abrt-cli.bash index 089d5a3..10b086a 100644 --- a/src/CLI/abrt-cli.bash +++ b/src/CLI/abrt-cli.bash @@ -1,7 +1,7 @@ # bash-completion add-on for abrt-cli(1) # http://bash-completion.alioth.debian.org/ -_abrt_cli() +_abrt_cli() { local cur prev opts COMPREPLY=() -- cgit