[Tutor] getopts question

Greg Perry gregp at liveammo.com
Fri Mar 30 05:33:00 CEST 2007


Hello List Members,

I am working on a simple program and would like to know the best way to approach this.  Using getops I am parsing the argv array to grab command line options; from the command line the user can specify either a filename or a directory (but not both).  Is there an eloquent way with getopts to do an either/or scenario without resorting to multiple tests to see which variable is set using if then statements?

Thanks in advance




More information about the Tutor mailing list