OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022

#include <argpar.h>

Public Attributes

const char * name
 
int key
 
const char * arg
 
int flags
 
const char * doc
 
int group
 

Detailed Description

Stores the configuration for a par argument.

The easiest way to use this is to create a static array at the top of your program to be passed to the argpar constructor, as shown below.

If the first four fields are 0, the option is considered a new section header and is only used for the automated usage statement.

Terminate the list with an empty struct.

static argpar_option options[] = {
{ "ifile", 'i', "FILE", 0, "input file" },
{ "ofile", 'o', "FILE", 0, "output file" },
{ 0,0,0,0, "This is another section:" },
{ "efile", 'e', "FILE", 0, "where to output stderr" },
{ 0 } // tell argpar to stop checking options
};

Definition at line 87 of file argpar.h.

Member Data Documentation

◆ arg

const char* arg

What to display as the right side of the argument in the usage statement.

If non-zero, this is the name of an argument associated with this option, which must be provided. If zero, it will be automatically determined based on the desired type, which may be modified with the flag argument.

Definition at line 98 of file argpar.h.

◆ doc

const char* doc

A (generally short) description of an option. In case of a documentation option, this may be as lengthy as required and will be wrapped to a reasonable size.

Definition at line 103 of file argpar.h.

◆ flags

int flags

Modify the behavior of the argument by OR'ing one or more OPTION_ macros.

Definition at line 100 of file argpar.h.

◆ group

int group

The group associated with this option. If 0 and a documentation option, it is auto-incremented.

The group number is used for display order in the usage statement. The order is 0, 1, 2, ..., n, -m, ..., -2, -1 and options in each group are displayed in the order they are given in the options specified.

Definition at line 111 of file argpar.h.

◆ key

int key

The value to pass to the parser callback. Must be a positive and non-zero.

Definition at line 91 of file argpar.h.

◆ name

const char* name

The key to search for.

Definition at line 89 of file argpar.h.


The documentation for this struct was generated from the following file:
  • /gfs-oceanweb/web/ocssw/ocssw_src/oel_util/libgenutils/argpar.h
Stores the configuration for a par argument.
Definition: argpar.h:87