diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-08-10 10:21:25 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-08-10 10:21:56 +0200 |
commit | 83a6ce9ad4b1828e163dc7172ef603201b748473 (patch) | |
tree | 9d0580eba6c01cb5964655df42bafab9de91329b /src/cli/abrt-cli.bash | |
parent | e84ab7783d05eb7b5f1b55ab44e7c23c85e50516 (diff) | |
download | abrt-83a6ce9ad4b1828e163dc7172ef603201b748473.tar.gz abrt-83a6ce9ad4b1828e163dc7172ef603201b748473.tar.xz abrt-83a6ce9ad4b1828e163dc7172ef603201b748473.zip |
lower case direcotry(no code changed)
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src/cli/abrt-cli.bash')
-rw-r--r-- | src/cli/abrt-cli.bash | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/cli/abrt-cli.bash b/src/cli/abrt-cli.bash new file mode 100644 index 00000000..fd0a85f3 --- /dev/null +++ b/src/cli/abrt-cli.bash @@ -0,0 +1,50 @@ +# bash-completion add-on for abrt-cli(1) +# http://bash-completion.alioth.debian.org/ + +# $1 = additional options for abrt-cli +_abrt_list() +{ + echo $(abrt-cli --list $1 | grep UUID | awk '{print $3}') + return 0 +} + +_abrt_cli() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="--help --version --list --report --delete" + + # + # Complete the arguments to some of the basic commands. + # + case "${prev}" in + --list) + opts="--full" + ;; + --report) + # Include only not-yet-reported crashes. + opts="--always $(_abrt_list)" + ;; + --always) # This is for --report --always + # Include only not-yet-reported crashes. + opts=$(_abrt_list) + ;; + --delete) + opts=$(_abrt_list "--full") + ;; + 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 |