1
0
Fork 0

Add error handling

This commit is contained in:
Andrew Tomaka 2014-06-16 15:24:54 -04:00
parent 28e00fca91
commit 6a0e924988

View file

@ -66,7 +66,7 @@ ssh_hosts_for_group () {
} }
show_ssh_groups () { show_ssh_groups () {
local groups=($(ssh_groups)) local readonly groups=($(ssh_groups))
local group local group
local group_number=0 local group_number=0
@ -95,11 +95,21 @@ cmdline () {
h) h)
info info
;; ;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit
;;
*) *)
usage usage
;; ;;
esac esac
done done
if [ $OPTIND -eq 1 ]
then
usage
fi
shift $((OPTIND-1)) shift $((OPTIND-1))
} }