[cs631apue] handling multiple command options

Jan Schaumann jschauma at stevens.edu
Sun Oct 9 17:24:11 EDT 2016

mseaton <mseaton at stevens.edu> wrote:

> So I have written a function that handles all outputs of this form only. 
> In another function I have written handles all of the command options 
> listed in the man pages, AaCc.... This is where I am using getopt. 

This is not the most straight forward approach, I think.

The typical approach would be to first call getopt(3) to parse the
command-line arguments, set suitable internal flags or variables, and
then act upon the remaining arguments.


More information about the cs631apue mailing list