]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: update disk-utils
authorSami Kerola <kerolasa@iki.fi>
Tue, 11 Apr 2017 19:30:02 +0000 (20:30 +0100)
committerSami Kerola <kerolasa@iki.fi>
Mon, 17 Apr 2017 17:12:10 +0000 (18:12 +0100)
fdformat:

Add --from, --to, and --repair options.

Commit: e0402441a143533d33d3c450471b2cd655407d77

fdisk:

Add --output [1], --bytes [2], --wipe [3], --wipe-partition [4], and
remove --geom- from from --cylinders, --heads, --sector options [5].

Commit [1]: fff8ad5882308825a131c645e4d28bcaef943351
Commit [2]: 354f8cc8cf06de44656fb83705c57062d04d1565
Commit [3]: cb9a4b0033eca429689a403be2a192fe2842f2e9
Commit [4]: ba465623d84b9e330f248a477d078b5f280b7943
Commit [5]: 4b4e391a28b4dfeb69781c20190bffe8622d1907

fsck.cramfs:

Broken since first commit.

Commit: bf60993cf2442f67bd47bcfcf6bd49c7392c2ba1

mkswap:

Provide random uuid when completing --uuid argument.

partx:

Add --sector-size option.  Fix also list of known partition types to
match with libblkid blkid_idinfo names.  The fix is also applied to
manual page.

Commit: f8a4a0d4f2fd569252029bd004e24ee433b43fe8

Reference: git grep -A 4 blkid_idinfo libblkid/src/partitions | grep name

sfdisk:

Add --reoder, --delete, --mode-dataa, -no-tell-kernel, --wipe, and
--wipe-partitions options.  In same go fix some option argument
completions.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/fdformat
bash-completion/fdisk
bash-completion/fsck.cramfs
bash-completion/mkswap
bash-completion/partx
bash-completion/sfdisk
disk-utils/partx.8

index d1b18fa0434e648c5e058d2a238f32488c2f9a8f..09cb0a28dd3621addc80b7b9a460274910fe97b5 100644 (file)
@@ -5,12 +5,24 @@ _fdformat_module()
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
+               '-f'|'--from'|'-t'|'--to'|'-r'|'--repair')
+                       COMPREPLY=( $(compgen -W "track_num" -- $cur) )
+                       return 0
+                       ;;
                '-h'|'--help'|'-V'|'--version')
                        return 0
                        ;;
        esac
        DEVS=$(for I in echo /dev/fd*; do if [ -e $I ]; then echo $I; fi; done)
-       OPTS="--no-verify --help --version $DEVS"
+       OPTS="
+               --from
+               --to
+               --repair
+               --no-verify
+               --help
+               --version
+               $DEVS
+       "
        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
        return 0
 }
index 0ba522ee488f3c0fddf3ba4c056161f5ac53e986..ef6c5beb4b0e0ce879486ea0fb26ee5e7406859d 100644 (file)
@@ -21,11 +21,46 @@ _fdisk_module()
                        COMPREPLY=( $(compgen -W "auto never always" -- $cur) )
                        return 0
                        ;;
+               '--output')
+                       local prefix realcur OUTPUT_ALL OUTPUT
+                       realcur="${cur##*,}"
+                       prefix="${cur%$realcur}"
+                       OUTPUT_ALL="
+                               Attrs
+                               Boot
+                               Bsize
+                               Cpg
+                               Cylinders
+                               Device
+                               End
+                               End-C/H/S
+                               Flags
+                               Fsize
+                               Id
+                               Name
+                               Sectors
+                               Size
+                               Slice
+                               Start
+                               Start-C/H/S
+                               Type
+                               Type-UUID
+                               UUID
+                       "
+                       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
+                       ;;
                '-u'|'--units')
                        COMPREPLY=( $(compgen -W "cylinders sectors" -- $cur) )
                        return 0
                        ;;
-               '-C'|'--geom-cylinders'|'-H'|'--geom-heads'|'-S'|'--geom-sectors')
+               '-C'|'--cylinders'|'-H'|'--heads'|'-S'|'--sectors')
                        COMPREPLY=( $(compgen -W "number" -- $cur) )
                        return 0
                        ;;
@@ -40,12 +75,16 @@ _fdisk_module()
                                --compatibility
                                --color
                                --list
+                               --output
                                --type
                                --units
                                --getsz
-                               --geom-cylinders
-                               --geom-heads
-                               --geom-sectors
+                               --bytes
+                               --wipe
+                               --wipe-partitions
+                               --cylinders
+                               --heads
+                               --sectors
                                --help
                                --version"
                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
index b3276b97452f0c18005ae7f9d57377e13af43a15..d17d2fea7a1b11019b3e1032c8ac310453e9b278 100644 (file)
@@ -5,7 +5,11 @@ _fsck.cramfs_module()
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
-               '-x'|'--destination')
+               '-b'|'--blocksize')
+                       COMPREPLY=( $(compgen -W "size" -- $cur) )
+                       return 0
+                       ;;
+               '--extract')
                        local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
index b72efafd9aaf09e1e1e89f1c2a4e4e17578f6dba..6ccc2142154d4ead5573ecde522841f880181161 100644 (file)
@@ -17,7 +17,11 @@ _mkswap_module()
                        COMPREPLY=( $(compgen -W "1" -- $cur) )
                        return 0
                        ;;
-               '-U'|'--uuid'|'-h'|'--help'|'-V'|'--version')
+               '-U'|'--uuid')
+                       COMPREPLY=( $(compgen -W "$(uuidgen -r)" -- $cur) )
+                       return 0
+                       ;;
+               '-h'|'--help'|'-V'|'--version')
                        return 0
                        ;;
        esac
index 804787f9d17a7d749a1c8a9b50e6bbe4f72b0e2a..921666274b9f68088e0cb5a0bf73f210d80929bb 100644 (file)
@@ -22,9 +22,13 @@ _partx_module()
                        COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
                        return 0
                        ;;
+               '-S'|'--sector-size')
+                       COMPREPLY=( $(compgen -W "size" -- $cur) )
+                       return 0
+                       ;;
                '-t'|'--type')
                        # FIXME: some command should list type libblkid knows.
-                       COMPREPLY=( $(compgen -W "aix bsd dos gpt mac minix sgi solaris_x86 sun ultrix unixware" -- $cur) )
+                       COMPREPLY=( $(compgen -W "aix bsd dos gpt mac minix PMBR sgi solaris sun ultrix unixware" -- $cur) )
                        return 0
                        ;;
                '-h'|'--help'|'-V'|'--version')
@@ -33,7 +37,23 @@ _partx_module()
        esac
        case $cur in
                -*)
-                       OPTS="--add --delete --show --update --bytes --noheadings --nr --output --pairs --raw --type --verbose --help --version"
+                       OPTS="
+                               --add
+                               --delete
+                               --update
+                               --show
+                               --bytes
+                               --noheadings
+                               --nr
+                               --output
+                               --pairs
+                               --raw
+                               --sector-size
+                               --type
+                               --verbose
+                               --help
+                               --version
+                       "
                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
                        return 0
                        ;;
index f8ae1f1b0f73adc8857016c6f733d5bcdf9bdbc4..c00e8c799b6d04afd3aa1665fe120274192659bc 100644 (file)
@@ -5,15 +5,37 @@ _sfdisk_module()
        cur="${COMP_WORDS[COMP_CWORD]}"
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
-               '-n'|'-C'|'--cylinders'|'-H'|'--heads'|'-S'|'--sectors')
+               '-d'|'--dump'|'-J'|'--json'|'-l'|'--list'|'-F'|'--list-free'|'-r'|'--reorder'|'-s'|'--show-size'|'-V'|'--verify'|'-A'|'--activate'|'--delete')
+                       COMPREPLY=( $(compgen -W "$(lsblk -dpnro name)" -- $cur) )
+                       return 0
+                       ;;
+               '-N'|'--partno')
                        COMPREPLY=( $(compgen -W "number" -- $cur) )
                        return 0
                        ;;
-               '--color')
+               '--color'|'-w'|'--wipe'|'-W'|'--wipe-partitions')
                        COMPREPLY=( $(compgen -W "auto never always" -- $cur) )
                        return 0
                        ;;
-               '-O'|'-I')
+               '-o'|'--output')
+                       local prefix realcur OUTPUT_ALL OUTPUT
+                       realcur="${cur##*,}"
+                       prefix="${cur%$realcur}"
+                       OUTPUT_ALL="
+                               Attrs Boot Bsize Cpg Cylinders Device End
+                               End-C/H/S Flags Fsize Id Name Sectors Size
+                               Slice Start Start-C/H/S Type Type-UUID UUID
+                       "
+                       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
+                       ;;
+               '-O'|'--backup-file')
                        local IFS=$'\n'
                        compopt -o filenames
                        COMPREPLY=( $(compgen -f -- $cur) )
@@ -35,9 +57,11 @@ _sfdisk_module()
                                --show-geometry
                                --list
                                --list-free
+                               --reorder
                                --show-size
                                --list-types
                                --verify
+                               --delete
                                --part-label
                                --part-type
                                --part-uuid
@@ -45,14 +69,18 @@ _sfdisk_module()
                                --append
                                --backup
                                --bytes
+                               --move-data
                                --force
                                --color
                                --partno
                                --no-act
                                --no-reread
+                               --no-tell-kernel
                                --backup-file
                                --output
                                --quiet
+                               --wipe
+                               --wipe-partitions
                                --label
                                --label-nested
                                --help
index 0d47f1c54e2e81f48206e463dffe1274d7ebf2e4..2dd34f209b23387d6d408ee8ef488c02d975f4c1 100644 (file)
@@ -126,8 +126,9 @@ Specify the partition table type, which can be one of
 .BR gpt ,
 .BR mac ,
 .BR minix ,
+.BR PMBR ,
 .BR sgi ,
-.BR solaris_x86 ,
+.BR solaris ,
 .BR sun ,
 .BR ultrix ,
 or