summaryrefslogtreecommitdiffstats
path: root/src/CLI
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-10-13 15:36:30 +0200
committerKarel Klic <kklic@redhat.com>2009-10-13 15:36:30 +0200
commit02181285b7cd564baa3898641798c66fdacddfaf (patch)
tree938a7a1dddcf5b7af39f08698223458e7e2ec554 /src/CLI
parent3d8d0cad460722317a1b95d99c669b98042056d6 (diff)
downloadabrt-02181285b7cd564baa3898641798c66fdacddfaf.tar.gz
abrt-02181285b7cd564baa3898641798c66fdacddfaf.tar.xz
abrt-02181285b7cd564baa3898641798c66fdacddfaf.zip
Initial bash completition file for abrt-cli
Diffstat (limited to 'src/CLI')
-rw-r--r--src/CLI/abrt-cli.bash-completition34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/CLI/abrt-cli.bash-completition b/src/CLI/abrt-cli.bash-completition
new file mode 100644
index 00000000..089d5a3f
--- /dev/null
+++ b/src/CLI/abrt-cli.bash-completition
@@ -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