diff options
Diffstat (limited to '')
-rw-r--r-- | bash-completion/mkfs | 28 | ||||
-rw-r--r-- | bash-completion/mkfs.bfs | 31 | ||||
-rw-r--r-- | bash-completion/mkfs.cramfs | 43 | ||||
-rw-r--r-- | bash-completion/mkfs.minix | 33 |
4 files changed, 135 insertions, 0 deletions
diff --git a/bash-completion/mkfs b/bash-completion/mkfs new file mode 100644 index 0000000..7f9d962 --- /dev/null +++ b/bash-completion/mkfs @@ -0,0 +1,28 @@ +_mkfs_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-t'|'--type') + FSTYPES=$(for I in /sbin/mkfs.* /usr/sbin/mkfs.*; do if [ -e $I ]; then echo ${I##*mkfs.}; fi; done) + COMPREPLY=( $(compgen -W "$FSTYPES" -- $cur) ) + return 0 + ;; + '-h'|'--help'|'-V'|'--version') + return 0 + ;; + esac + case $cur in + -*) + OPTS='--type --verbose --help --version' + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac + compopt -o bashdefault -o default + COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) + return 0 +} +complete -F _mkfs_module mkfs diff --git a/bash-completion/mkfs.bfs b/bash-completion/mkfs.bfs new file mode 100644 index 0000000..4f59051 --- /dev/null +++ b/bash-completion/mkfs.bfs @@ -0,0 +1,31 @@ +_mkfs.bfs_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-N'|'--inodes') + COMPREPLY=( $(compgen -W "number" -- $cur) ) + return 0 + ;; + '-V'|'--vname'|'-F'|'--fname') + COMPREPLY=( $(compgen -W "name" -- $cur) ) + return 0 + ;; + '-h'|'--help'|'--version') + return 0 + ;; + esac + case $cur in + -*) + OPTS='--inodes --vname --fname --verbose --help --version' + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac + compopt -o bashdefault -o default + COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) + return 0 +} +complete -F _mkfs.bfs_module mkfs.bfs diff --git a/bash-completion/mkfs.cramfs b/bash-completion/mkfs.cramfs new file mode 100644 index 0000000..fa74d4c --- /dev/null +++ b/bash-completion/mkfs.cramfs @@ -0,0 +1,43 @@ +_mkfs.cramfs_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-b') + COMPREPLY=( $(compgen -W "blksize" -- $cur) ) + return 0 + ;; + '-e') + COMPREPLY=( $(compgen -W "edition" -- $cur) ) + return 0 + ;; + '-N') + COMPREPLY=( $(compgen -W "big little host" -- $cur) ) + return 0 + ;; + '-i') + COMPREPLY=( $(compgen -f -- $cur) ) + return 0 + ;; + '-n') + COMPREPLY=( $(compgen -W "name" -- $cur) ) + return 0 + ;; + '-h'|'-V') + return 0 + ;; + esac + case $cur in + -*) + OPTS="-h -v -E -b -e -N -i -n -p -s -z" + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac + compopt -o bashdefault -o default + COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) + return 0 +} +complete -F _mkfs.cramfs_module mkfs.cramfs diff --git a/bash-completion/mkfs.minix b/bash-completion/mkfs.minix new file mode 100644 index 0000000..e9413f7 --- /dev/null +++ b/bash-completion/mkfs.minix @@ -0,0 +1,33 @@ +_mkfs.minix_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + case $prev in + '-i'|'--inodes') + COMPREPLY=( $(compgen -W "inodes" -- $cur) ) + return 0 + ;; + '-l'|'--badblocks') + compopt -o filenames + COMPREPLY=( $(compgen -f -- $cur) ) + return 0 + ;; + '-n'|'--namelength') + COMPREPLY=( $(compgen -W "14 30 60" -- $cur) ) + return 0 + ;; + esac + case $cur in + -*) + OPTS="--namelength --inodes --check --badblocks --help --version -1 -2 -3" + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 + ;; + esac + compopt -o bashdefault -o default + COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) + return 0 +} +complete -F _mkfs.minix_module mkfs.minix |