]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: update fincore to have latest options
authorSami Kerola <kerolasa@iki.fi>
Thu, 23 Mar 2017 22:05:23 +0000 (22:05 +0000)
committerKarel Zak <kzak@redhat.com>
Fri, 24 Mar 2017 10:51:55 +0000 (11:51 +0100)
Also include --output smartcols fields.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/fincore

index d213586cab6621f613e3b3ed0205bcc5e35ee2b1..9b1aed8f3c2ea34583bb1b7737038915c8d21c77 100644 (file)
@@ -5,14 +5,35 @@ _fincore_module()
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
+               '-o'|'--output')
+                       local prefix realcur OUTPUT_ALL OUTPUT
+                       realcur="${cur##*,}"
+                       prefix="${cur%$realcur}"
+                       OUTPUT_ALL='PAGES SIZE FILE'
+                       for WORD in $OUTPUT_ALL; do
+                               if ! [[ $prefix == *"$WORD"* ]]; then
+                                       OUTPUT="$WORD $OUTPUT"
+                               fi
+                       done
+                       compopt -o nospace
+                       COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") )
+                       return 0
+                       ;;
                '-h'|'--help'|'-V'|'--version')
                        return 0
                        ;;
        esac
        case $cur in
            -*)
-                       OPTS="--help
-                               --version"
+                       OPTS="
+                               --json
+                               --bytes
+                               --noheadings
+                               --output
+                               --raw
+                               --help
+                               --version
+                       "
                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
                        return 0
                        ;;