mirror of
https://github.com/iustin/mt-st.git
synced 2025-12-23 05:45:13 +00:00
Update auto completion to suggest stoptions where relevant
This commit is contained in:
committed by
Iustin Pop
parent
aa6539b4b1
commit
32fba27f78
@@ -7,6 +7,7 @@ _mt () {
|
||||
|
||||
#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 stshowoptions"
|
||||
stoptions="buffer-writes async-writes read-ahead debug two-fms fast-eod no-wait weof-no-wait auto-lock def-writes can-bsr no-blklimits can-partitions scsi2logical sili sysv"
|
||||
|
||||
COMPREPLY=()
|
||||
|
||||
@@ -22,8 +23,19 @@ _mt () {
|
||||
COMPREPLY=($(compgen -W "$devs" -- "$cur"))
|
||||
return
|
||||
;;
|
||||
stsetoptions)
|
||||
# show list of stoptions
|
||||
COMPREPLY=($(compgen -W "$stoptions" -- "$cur"))
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
# if "$prev" is a substring of "$stoptions" show more "$stoptions"
|
||||
if [[ "$stoptions" == *"$prev"* ]]; then
|
||||
COMPREPLY=($(compgen -W "$stoptions" -- "$cur"))
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ $cur == -* ]]; then
|
||||
COMPREPLY=($(compgen -W '-f -v' -- "$cur"))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user