]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - bash-completion/partx
tests: remove device name from blkdiscard output
[thirdparty/util-linux.git] / bash-completion / partx
index 921666274b9f68088e0cb5a0bf73f210d80929bb..2430e40fec24a91564f9f0abfd36d580934fbc3d 100644 (file)
@@ -15,7 +15,7 @@ _partx_module()
                        prefix="${cur%$realcur}"
                        for WORD in $OUTPUT_ALL; do
                                if ! [[ $prefix == *"$WORD"* ]]; then
-                                       OUTPUT="$WORD $OUTPUT"
+                                       OUTPUT="$WORD ${OUTPUT:-""}"
                                fi
                        done
                        compopt -o nospace
@@ -27,8 +27,7 @@ _partx_module()
                        return 0
                        ;;
                '-t'|'--type')
-                       # FIXME: some command should list type libblkid knows.
-                       COMPREPLY=( $(compgen -W "aix bsd dos gpt mac minix PMBR sgi solaris sun ultrix unixware" -- $cur) )
+                       COMPREPLY=( $(compgen -W "$(partx --list-types)" -- $cur) )
                        return 0
                        ;;
                '-h'|'--help'|'-V'|'--version')
@@ -46,10 +45,12 @@ _partx_module()
                                --noheadings
                                --nr
                                --output
+                               --output-all
                                --pairs
                                --raw
                                --sector-size
                                --type
+                               --list-types
                                --verbose
                                --help
                                --version
@@ -58,6 +59,7 @@ _partx_module()
                        return 0
                        ;;
        esac
+       compopt -o bashdefault -o default
        COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
        return 0
 }