mirror of
https://github.com/msmhq/msm.git
synced 2024-08-30 18:12:35 +00:00
Adde cash completion for the server "operator" commands.
This commit is contained in:
parent
3b3b918a0e
commit
ba70f48b05
@ -169,6 +169,29 @@ _msm() {
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
operator|op)
|
||||
if [[ $COMP_CWORD == 3 ]]; then
|
||||
options="add remove list"
|
||||
else
|
||||
case "${COMP_WORDS[3]}" in
|
||||
remove)
|
||||
if [[ $COMP_CWORD == 4 ]]; then
|
||||
local ops_path="${server_path}/$DEFAULT_OPS"
|
||||
|
||||
# Override with server specific value if present
|
||||
local server_conf="${server_path}/$DEFAULT_SERVER_CONF"
|
||||
if [ -f "$server_conf" ]; then
|
||||
ops_path=$(grep "^OPS=\".*\"" $server_conf | awk -F '"' '{print $2}')
|
||||
fi
|
||||
|
||||
if [ -f "$ops_path" ]; then
|
||||
options="$(cat "$ops_path")"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user