From: Sami Kerola Date: Sun, 13 Mar 2016 10:31:45 +0000 (+0000) Subject: bash-completion: fsck.cramfs, isosize: find files an argument X-Git-Tag: v2.28-rc2~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f57e1420c425da514eb4f4c32c8185442d029c3;p=thirdparty%2Futil-linux.git bash-completion: fsck.cramfs, isosize: find files an argument Earlier completion suggested only options for the command, this changes options to be proposed when first character of an argument is dash. Signed-off-by: Sami Kerola --- diff --git a/bash-completion/fsck.cramfs b/bash-completion/fsck.cramfs index acf656411d..b3276b9745 100644 --- a/bash-completion/fsck.cramfs +++ b/bash-completion/fsck.cramfs @@ -15,8 +15,15 @@ _fsck.cramfs_module() return 0 ;; esac - OPTS='--verbose --destination --help --version file' - COMPREPLY=( $(compgen -W "${OPTS[*]}" -S ' ' -- $cur) ) + case $cur in + -*) + COMPREPLY=( $(compgen -W "--verbose --blocksize --extract --help --version" -- $cur) ) + return 0 + ;; + esac + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _fsck.cramfs_module fsck.cramfs diff --git a/bash-completion/isosize b/bash-completion/isosize index 13d4d298a7..fec2f8b8f4 100644 --- a/bash-completion/isosize +++ b/bash-completion/isosize @@ -13,8 +13,15 @@ _isosize_module() return 0 ;; esac - OPTS='--divisor --sectors --help --version' - COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + case $cur in + -*) + COMPREPLY=( $(compgen -W "--divisor --sectors --help --version" -- $cur) ) + return 0 + ;; + esac + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $(compgen -f -- $cur) ) return 0 } complete -F _isosize_module isosize