]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - bash-completion/mkfs
various: fix 'uninitialized when used' warnings [clang]
[thirdparty/util-linux.git] / bash-completion / mkfs
index 19471195ec3c03d34886d7677c2eec5056882d3e..a27874714e6b34159be89a9bddcf8c1737f882f6 100644 (file)
@@ -1,6 +1,6 @@
 _mkfs_module()
 {
-       local cur prev OPTS DEVS
+       local cur prev OPTS
        COMPREPLY=()
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
@@ -10,16 +10,18 @@ _mkfs_module()
                        COMPREPLY=( $(compgen -W "$FSTYPES" -- $cur) )
                        return 0
                        ;;
+               '-h'|'--help'|'-V'|'--version')
+                       return 0
+                       ;;
        esac
        case $cur in
                -*)
-                       OPTS='-t --type --verbose -h --help -V --version'
+                       OPTS='--type --verbose --help --version'
                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
                        return 0
                        ;;
        esac
-       while read dev; do DEVS+="$dev " ; done < <(lsblk -pnro name)
-       COMPREPLY=( $(compgen -W "$DEVS /path/to/file" -- $cur) )
+       COMPREPLY=( $(compgen -W "$(lsblk -pnro name) /path/to/file" -- $cur) )
        return 0
 }
 complete -F _mkfs_module mkfs