Section 26.7. Handling Extra Arguments


26.7. Handling Extra Arguments

Some applications implement the equivalent of option aliasing but need to do so through special logic. The poptStuffArgs() function allows an application to insert new arguments into the current poptContext.

 #include <popt.h> int poptStuffArgs(poptContext con, char ** argv); 

The passed argv must have a NULL pointer as its final element. When poptGetNextOpt() is next called, the "stuffed" arguments are the first to be parsed. popt returns to the normal arguments once all the stuffed arguments have been exhausted.


    Linux Application Development
    Linux Application Development (paperback) (2nd Edition)
    ISBN: 0321563220
    EAN: 2147483647
    Year: 2003
    Pages: 168 © 2008-2017.
    If you may any questions please contact us: