From 99d8ed0ac53f8ede5dedcfb25fd5f9085b131f0b Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 11 Apr 2017 20:30:02 +0100 Subject: bash-completion: update disk-utils 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 --- bash-completion/fdisk | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'bash-completion/fdisk') diff --git a/bash-completion/fdisk b/bash-completion/fdisk index 0ba522ee4..ef6c5beb4 100644 --- a/bash-completion/fdisk +++ b/bash-completion/fdisk @@ -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) ) -- cgit v1.2.3-55-g7522