Xiqual 0.9.1

In file xitools/opts.c:

xiargs* xi_getopts

(int argc,
  char* argv[],
  char* description,
  char* usage,
  xiopts* opts)

Parse command args.


Parse command args. This function takes the arguments passed to a program and sorts them according to a user-supplied xiopts structure.

The different types of options supported are LOT_FLAG, LOT_KEYWORD, LOT_VALUE and LOT_FLOAT. The OptNode structures in the xiargs returned will have this type set, and the appropriate data field will contain the argument to the option.

An option that wasn't specified by the user will not be present in the list. Non-option arguments are in the leftovers List.

See the testopts.c sourcecode for example usage. Note that you won't need to supply your own usage display function.

argc - Argument count from the calling program.
argv - Actual argument list from the caller.
- description Brief description of the program.
usage - One-line usage string. See any manpage for an example.
- xiopts A structure with option names, types and descriptions.
A structure containing lists of options with arguments, plus leftover arguments. If no arguments were supplied, NULL is supplied after displaying program and option descriptions.
Ronny Bangsund
See Also:
xi_freeopts(), xiargs, OptNode, testopts.c

Alphabetic index

This page was generated with the help of DOC++.