#!/bin/bash # Alex Dehnert scriptname=$0 status=resolved usage="Usage: \"$scriptname [-h] [-s status] ticket [...]\"" while getopts "s:h" options; do case $options in s ) status=$OPTARG;; h ) echo "$usage"; exit 0;; \? ) echo "$usage" exit 1;; * ) echo "$usage" exit 1;; esac done shift $(expr $OPTIND - 1) tickets="" for ticket in "$@"; do tickets="$tickets ticket/$ticket" done athrun tooltime rt edit $tickets set "status=$status"