RDM_CMDLINE_OPT Struct Reference

Generic usage function option record. More...

#include "rdmcmdlinetypes.h"

Data Fields

const char * optShort
const char * optLong
const char * arg
const char * desc

Detailed Description

Field Documentation

arg

const char* RDM_CMDLINE_OPT::arg

Option argument or argument.

An option that takes arguments have an entry here with any of these formats:

  • s =... for a string option argument,
  • i=... for an integer option argument, and
  • c=. for a single character option argument.

A standalone argument have an entry here with any of these formats:

  • #=... for a single command line argument,
  • *=... for zero or more command line arguments, and
  • ?=... for an optional argument.

It only makes sense to have one '*=...' and it should always be the second last element in the array of command line parsing options. The string after the equal sign (shown above as '...') is a documentation string for the argument.

desc

const char* RDM_CMDLINE_OPT::desc

Option or argument description. This string is only for documentation purposes and will be printed with the '-h' or '-help' option.

optLong

const char* RDM_CMDLINE_OPT::optLong

Long option is a string of at least a few characters used to match against. A long option is a command line option that starts with '-' followed by the exact sequence of characters specified here.

rdm_cmdlineNextLongOption will return this string for a match except when it is NULL.

optShort

const char* RDM_CMDLINE_OPT::optShort

Short option is a single character used to match against. A short option is a command line option that starts with '-' followed by a sequence of characters where one of these characters are the one specified here. rdm_cmdlineNextShortOption (and rdm_cmdlineNextLongOption when optLong is NULL) will return this string for a match.

The last element in the array of command line parsing options should have optShort set to NULL.


The documentation for this struct was generated from the following file: