dk: aliases de filtres
This commit is contained in:
parent
1b12cee1fb
commit
ccf3c67278
13
dk
13
dk
|
@ -106,6 +106,9 @@ COMMANDES
|
|||
- name=<string> a task's name or prefix
|
||||
- node=<string> a node's name or ID
|
||||
- desired-state=(running|shutdown|accepted)
|
||||
Pour faciliter l'utilisation des filtres, certains aliases sont définis.
|
||||
'=r', '=k' et '=a' sont des aliases pour desired-state=running,
|
||||
desired-state=shutdown et desired-state=accepted respectivement
|
||||
u|update SERVICE [args...]
|
||||
Mettre à jour un service, équivalent à 'service update SERVICE'
|
||||
scale SERVICE=REPLICAS [args...]
|
||||
|
@ -1301,12 +1304,18 @@ function auto_status() {
|
|||
fi
|
||||
|
||||
local -a psargs
|
||||
local fnum
|
||||
local filter fnum
|
||||
psargs=(
|
||||
--format "taskID={{.ID}};node={{.Node}};desiredState='{{.DesiredState}}';currentState='{{.CurrentState}}';__status_process_data"
|
||||
)
|
||||
while [[ "$1" == *=* ]]; do
|
||||
psargs+=(--filter "$1")
|
||||
filter="$1"
|
||||
case "$filter" in
|
||||
=r) filter="desired-state=running";;
|
||||
=k) filter="desired-state=shutdown";;
|
||||
=a) filter="desired-state=accepted";;
|
||||
esac
|
||||
psargs+=(--filter "$filter")
|
||||
shift
|
||||
done
|
||||
fnum="$1"; shift
|
||||
|
|
Loading…
Reference in New Issue