diff options
author | Kenneth D'souza <kdsouza@redhat.com> | 2019-04-17 16:57:05 +0530 |
---|---|---|
committer | Pavel Shilovsky <pshilov@microsoft.com> | 2019-04-18 12:01:47 -0700 |
commit | dfe497f9f51983147a7caa69f62bb6648ea507ec (patch) | |
tree | bc11152534c61e7f9e38c3c2aa394f48b304c332 | |
parent | 9beaa8c3c895ca8460d81fb54a6a0de2bb21a277 (diff) | |
download | cifs-utils-dfe497f9f51983147a7caa69f62bb6648ea507ec.tar.gz cifs-utils-dfe497f9f51983147a7caa69f62bb6648ea507ec.tar.bz2 cifs-utils-dfe497f9f51983147a7caa69f62bb6648ea507ec.zip |
smbinfo: Add bash completion support for smbinfo.
This help us better populate options using <tab> <tab>.
Signed-off-by: Kenneth D'souza <kdsouza@redhat.com>
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
-rw-r--r-- | bash-completion/smbinfo | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bash-completion/smbinfo b/bash-completion/smbinfo new file mode 100644 index 0000000..ad5d34d --- /dev/null +++ b/bash-completion/smbinfo @@ -0,0 +1,42 @@ +# bash completion for smbinfo -*- shell-script -*- +smb_info() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + OPTS="fileaccessinfo + filealigninfo + fileallinfo + filebasicinfo + fileeainfo + filefsfullsizeinfo + fileinternalinfo + filemodeinfo + filepositioninfo + filestandardinfo + fsctl-getobjid + list-snapshots + quota + secdesc" + case $prev in + '-v'|'-h') + return 0 + ;; + 'fileaccessinfo'|'filealigninfo'|'fileallinfo'|'filebasicinfo'|'fileeainfo'|'filefsfullsizeinfo'|\ + 'fileinternalinfo'|'filemodeinfo'|'filepositioninfo'|'filestandardinfo'|'fsctl-getobjid'|\ + 'list-snapshots'|'quota'|'secdesc') + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $(compgen -f -o dirnames -- ${cur:-""}) ) + return 0 + ;; + '-V'|*'smbinfo') + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac + + return 0 +} +complete -F smb_info smbinfo |