Commit cb2e3e90 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gitask: add cancel support

parent 2566cf20
...@@ -14,10 +14,15 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then ...@@ -14,10 +14,15 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Use: gitask [GIRAR] [task|show|ls|quota]" echo "Use: gitask [GIRAR] [task|show|ls|quota]"
echo "$HELP_GIRAR" echo "$HELP_GIRAR"
echo " --help - help" echo " --help - help"
docmd ssh $GEARHOST task help docmd ssh $GEARHOST task help | sed -e "s|abort|cancel|g"
exit 0 exit 0
fi fi
get_last()
{
ssh $GEARHOST task ls | head -n1 | sed -e "s|^#\([0-9]*\) .*|\1|g" || fatal
}
# TODO: acl # TODO: acl
epm assure girar-show girar-utils epm assure girar-show girar-utils
...@@ -31,7 +36,7 @@ if [ "$1" = "get" ] ; then ...@@ -31,7 +36,7 @@ if [ "$1" = "get" ] ; then
echo "$SUBTASK" echo "$SUBTASK"
exit exit
elif [ "$1 $2 $3" = "get last " ] || [ "$1 $2 $3" = "get last task" ] ; then elif [ "$1 $2 $3" = "get last " ] || [ "$1 $2 $3" = "get last task" ] ; then
TASK="$(ssh $GEARHOST task ls | head -n1 | sed -e "s|^#\([0-9]*\) .*|\1|g")" || fatal TASK="$(get_last)" || fatal
echo "$TASK" echo "$TASK"
exit exit
else else
...@@ -72,6 +77,13 @@ if [ "$1" = "quota" ] ; then ...@@ -72,6 +77,13 @@ if [ "$1" = "quota" ] ; then
exit exit
fi fi
if [ "$1" = "cancel" ] ; then
shift
#TASK="$(get_last)" || fatal
docmd ssh $GEARHOST task abort "$@"
exit
fi
if [ "$1" = "task" ] ; then if [ "$1" = "task" ] ; then
# by default # by default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment