diff options
author | Karel Klic <kklic@redhat.com> | 2010-06-22 15:08:12 +0200 |
---|---|---|
committer | Karel Klic <kklic@redhat.com> | 2010-06-22 15:08:12 +0200 |
commit | b779e34fa9b133dad1e183bf8145a017c1bf15d2 (patch) | |
tree | f04b0638a76c9bc3814a1004942c548870b17b44 /src | |
parent | 06241a7f480159f0c999aaaf83e5eef92860b858 (diff) | |
download | abrt-b779e34fa9b133dad1e183bf8145a017c1bf15d2.tar.gz abrt-b779e34fa9b133dad1e183bf8145a017c1bf15d2.tar.xz abrt-b779e34fa9b133dad1e183bf8145a017c1bf15d2.zip |
Bash completion update
Diffstat (limited to 'src')
-rw-r--r-- | src/CLI/abrt-cli.bash | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/CLI/abrt-cli.bash b/src/CLI/abrt-cli.bash index 10b086ae..fd0a85f3 100644 --- a/src/CLI/abrt-cli.bash +++ b/src/CLI/abrt-cli.bash @@ -1,22 +1,38 @@ # 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 --get-list --get-list-full --report --report-always --delete" + opts="--help --version --list --report --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 + --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 |