change type of grab_opt from int to bool
move match declaration closer to first use
change error message format, use strerror()