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
1 changed files with 11 additions and 1 deletions

View File

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