mirror of
https://github.com/iustin/mt-st.git
synced 2026-01-03 10:55:15 +00:00
Rename mt-st to mt-st.bash_completion
This commit is contained in:
committed by
Iustin Pop
parent
a109c716d8
commit
639ece4580
39
mt-st.bash_completion
Normal file
39
mt-st.bash_completion
Normal file
@@ -0,0 +1,39 @@
|
||||
#mt bash completion by Paweł Marciniak <sunwire<at>gmail.com>
|
||||
#
|
||||
|
||||
_mt () {
|
||||
local cur prev words cword
|
||||
_init_completion || return
|
||||
|
||||
#possible commands
|
||||
commands="weof wset eof fsf fsfm bsf bsfm fsr bsr fss bss rewind offline rewoffl eject retension eod seod seek tell status erase setblk lock unlock load compression setdensity drvbuffer stwrthreshold stoptions stsetoptions stclearoptions defblksize defdensity defdrvbuffer defcompression stsetcln sttimeout stlongtimeout densities setpartition mkpartition partseek asf stshowopt"
|
||||
|
||||
COMPREPLY=()
|
||||
|
||||
case $prev in
|
||||
-v | --version)
|
||||
return
|
||||
;;
|
||||
-f )
|
||||
if [ -x "$(command -v udevadm)" ]; then
|
||||
#list tape devices
|
||||
for d in `udevadm trigger --verbose --dry-run --type=devices --subsystem-match=scsi_tape`; do
|
||||
devs+="/dev/${d##*/} "
|
||||
done
|
||||
COMPREPLY=($(compgen -W "$devs" -- "$cur"))
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ $cur == -* ]]; then
|
||||
COMPREPLY=($(compgen -W '-f -v' -- "$cur"))
|
||||
return
|
||||
fi
|
||||
|
||||
COMPREPLY=($(compgen -W "$commands" -- "$cur"))
|
||||
|
||||
}
|
||||
complete -F _mt mt
|
||||
Reference in New Issue
Block a user