add support for do ... syntax

This commit is contained in:
sloane 2024-03-18 16:20:10 -04:00
parent dd664c97a3
commit cbb0dd3fe0
No known key found for this signature in database

View file

@ -1,9 +1,18 @@
function vitally function vitally
set cmd $argv[1] set cmd $argv[1]
set cmds start stop session-name init
if not contains $cmd $cmds if not contains $cmd start stop session-name init do
echo "usage: vitally <CMD>; <CMD>: start, stop, session-name, init" echo "usage: vitally <CMD>; <CMD>: start, stop, session-name, init"
return 1
end
if test $cmd = "do"
set cmds (string replace -a ',' '' $argv[2..])
else else
eval "vitally-$cmd" set cmds $cmd
end
for c in $cmds
eval "vitally-$c"
end end
end end