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
echo "Use: gitask [GIRAR] [task|show|ls|quota]"
echo "$HELP_GIRAR"
echo " --help - help"
docmd ssh $GEARHOST task help
docmd ssh $GEARHOST task help | sed -e "s|abort|cancel|g"
exit 0
fi
get_last()
{
ssh $GEARHOST task ls | head -n1 | sed -e "s|^#\([0-9]*\) .*|\1|g" || fatal
}
# TODO: acl
epm assure girar-show girar-utils
......@@ -31,7 +36,7 @@ if [ "$1" = "get" ] ; then
echo "$SUBTASK"
exit
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"
exit
else
......@@ -72,6 +77,13 @@ if [ "$1" = "quota" ] ; then
exit
fi
if [ "$1" = "cancel" ] ; then
shift
#TASK="$(get_last)" || fatal
docmd ssh $GEARHOST task abort "$@"
exit
fi
if [ "$1" = "task" ] ; then
# 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