BRL-CAD
Command-line Option Parsing
Collaboration diagram for Command-line Option Parsing:

Files

file  getopt.c
 Special portable re-entrant version of getopt.
 

Functions

int bu_getopt (int nargc, char *const nargv[], const char *ostr)
 

Variables

int bu_opterr
 
int bu_optind
 
int bu_optopt
 
char * bu_optarg
 

Detailed Description

Function Documentation

int bu_getopt ( int  nargc,
char *const  nargv[],
const char *  ostr 
)

Get option letter from argument vector.

returns the next known option character in ostr. If bu_getopt() encounters a character not found in ostr or if it detects a missing option argument, it returns `?' (question mark). If ostr has a leading `:' then a missing option argument causes `:' to be returned instead of `?'. In either case, the variable bu_optopt is set to the character that caused the error. The bu_getopt() function returns -1 when the argument list is exhausted.

Definition at line 43 of file getopt.c.

References bu_optarg, bu_optind, bu_optopt, EMSG, strchr(), and tell.

Referenced by _ged_drawtrees(), dm_processOptions(), fbo_open_tcl(), ged_bb(), ged_bev(), ged_bo(), ged_bot_decimate(), ged_bot_fuse(), ged_comb(), ged_comb_std(), ged_combmem(), ged_concat(), ged_E(), ged_edcodes(), ged_edit(), ged_edmater(), ged_facetize(), ged_find(), ged_gdiff(), ged_get_autoview(), ged_keep(), ged_kill(), ged_killtree(), ged_lc(), ged_list(), ged_ls(), ged_make(), ged_mirror(), ged_move_all(), ged_png(), ged_preview(), ged_ps(), ged_pull(), ged_push(), ged_red(), ged_rselect(), ged_saveview(), ged_search(), ged_select(), ged_tops(), ged_tree(), ged_voxelize(), get_args(), main(), read_args(), and ReadArgs().

Here is the call graph for this function:

Variable Documentation

int bu_opterr

for bu_getopt(). set to zero to suppress errors.

Definition at line 88 of file globals.c.

Referenced by dm_processOptions(), fbo_open_tcl(), ged_bo(), ged_bot_decimate(), ged_bot_fuse(), ged_concat(), ged_edit(), ged_gdiff(), get_args(), and read_args().

int bu_optopt

for bu_getopt(). current option being checked for validity.

Definition at line 90 of file globals.c.

Referenced by bu_getopt(), dm_processOptions(), ged_edit(), ged_gdiff(), ged_make(), ged_mirror(), ged_search(), and main().