Products Support Documentation Download
RDM_CMDLINE_OPT_A Struct Reference

Generic usage function option record. More...

#include "rdmcmdlineapi.h"

Data Fields

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

Detailed Description

Generic usage function option record.

Definition at line 50 of file rdmcmdlineapi.h.

Field Documentation

◆ arg

const char* RDM_CMDLINE_OPT_A::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.

Definition at line 60 of file rdmcmdlineapi.h.

◆ desc

const char* RDM_CMDLINE_OPT_A::desc

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

Definition at line 78 of file rdmcmdlineapi.h.

◆ optLong

const char* RDM_CMDLINE_OPT_A::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.

Definition at line 56 of file rdmcmdlineapi.h.

◆ optShort

const char* RDM_CMDLINE_OPT_A::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.

Definition at line 51 of file rdmcmdlineapi.h.


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