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
|
- name=<string> a task's name or prefix
|
||||||
- node=<string> a node's name or ID
|
- node=<string> a node's name or ID
|
||||||
- desired-state=(running|shutdown|accepted)
|
- 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...]
|
u|update SERVICE [args...]
|
||||||
Mettre à jour un service, équivalent à 'service update SERVICE'
|
Mettre à jour un service, équivalent à 'service update SERVICE'
|
||||||
scale SERVICE=REPLICAS [args...]
|
scale SERVICE=REPLICAS [args...]
|
||||||
|
@ -1301,12 +1304,18 @@ function auto_status() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local -a psargs
|
local -a psargs
|
||||||
local fnum
|
local filter fnum
|
||||||
psargs=(
|
psargs=(
|
||||||
--format "taskID={{.ID}};node={{.Node}};desiredState='{{.DesiredState}}';currentState='{{.CurrentState}}';__status_process_data"
|
--format "taskID={{.ID}};node={{.Node}};desiredState='{{.DesiredState}}';currentState='{{.CurrentState}}';__status_process_data"
|
||||||
)
|
)
|
||||||
while [[ "$1" == *=* ]]; do
|
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
|
shift
|
||||||
done
|
done
|
||||||
fnum="$1"; shift
|
fnum="$1"; shift
|
||||||
|
|
Loading…
Reference in New Issue