---
name: "cmdoptns.h"
section: "3cc"
platform: "linux"
package: "libcommoncpp2-dev"
version: "1.0.13-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/cmdoptns.h/3cc"
---

# cmdoptns.h(3cc)

Command line option parsing interface.

## NAME

cmdoptns.h - Command line option parsing interface.

## SYNOPSIS

`#include <cc++/config.h>`\

### Compounds

class **CommandOption**\
 *CommandOption is the base class for all command line options.* class **CommandOptionArg**\
 *Class for options with an argument e.g.* class **CommandOptionCollect**\
 *It only makes sense to have a single one of these set and it is also exclusive with* **CommandOptionRest***.* **CommandOption** *to collect parameters that are not options.* class **CommandOptionNoArg**\
 **CommandOption** *type for flags.* class **CommandOptionParse**\
 *This is the CommandOptionParse interface class.* class **CommandOptionRest**\
 *It only makes sense to have a single one of these set and it is exclusive with* **CommandOptionCollect***.* **CommandOption** *to take the rest of the command line.* class **CommandOptionWithArg**\
 *Derived class of* **CommandOption** *for options that have a value associated with them.*

### Functions

**CommandOptionParse** \* **makeCommandOptionParse** (int argc, char \*\*argv, char \*comment, **CommandOption** \*options=**defaultCommandOptionList**)\
 *makeCommandOptionParse will create an implementation of a* **CommandOptionParse** *object.*

### Variables

**CommandOption** \* **defaultCommandOptionList**\
 *This defines a linked list head pointer for all the command line options that use the default list.*

## DETAILED DESCRIPTION

Command line option parsing interface.

## FUNCTION DOCUMENTATION

### CommandOptionParse\* makeCommandOptionParse (int argc, char \*\* argv, char \* comment, CommandOption \* options = defaultCommandOptionList)

makeCommandOptionParse will create an implementation of a **CommandOptionParse** object.

This particular implementation is a wrapper around [getopt\_long(3)](/getopt_long/3.md). That interface unfortunatly does not provide enough information to give the best error messages with malformed input. If the implementation changes there is a good chance that the binary interface will remain the same.

## VARIABLE DOCUMENTATION

### CommandOption\* defaultCommandOptionList

This defines a linked list head pointer for all the command line options that use the default list.

It will most likely be used in most cases without being explicitly referenced in application code. It is a default value of various method's parameters.

## AUTHOR

Generated automatically by Doxygen for CommonC++ from the source code.
