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

# CommandOptionWithArg(3cc)

Derived class of CommandOption for options that have a value associated with them.

## NAME

CommandOptionWithArg - Derived class of **CommandOption** for options that have a value associated with them.

## SYNOPSIS

`#include <cmdoptns.h>`

Inherits **CommandOption**.

Inherited by **CommandOptionArg**, **CommandOptionCollect**, and **CommandOptionRest**.

### Public Methods

**CommandOptionWithArg** (const char \*inOptionName, const char \*inOptionLetter, const char \*inDescription, **OptionType** inOptionType, bool inRequired=false, **CommandOption** \*\*ppNext=&**defaultCommandOptionList**)\
 *CommandOptionWithArg contructor.* virtual **~CommandOptionWithArg** ()\
 virtual void **foundOption** (**CommandOptionParse** \*cop, const char \*value=0)\
 virtual void **foundOption** (**CommandOptionParse** \*cop, const char \*\*value, int num)\
 virtual bool **hasValue** ()\

### Public Attributes

const char \*\* **values**\
 *Array of list of values collected for this option.* int **numValue**\
 **Number** *of values in the values array.*

## DETAILED DESCRIPTION

Derived class of **CommandOption** for options that have a value associated with them.

Classes **CommandOptionRest** and **CommandOptionArg** derive from this class.

## CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

### CommandOptionWithArg::CommandOptionWithArg (const char \* inOptionName, const char \* inOptionLetter, const char \* inDescription, OptionType inOptionType, bool inRequired = false, CommandOption \*\* ppNext = &defaultCommandOptionList)

CommandOptionWithArg contructor.

Note the default values for required and ppNext.

**Parameters:**

- *inOptionName*

  *long option name*

- *inOptionLetter*

  *short letter name*

- *inDescription*

  *short description of the option*

- *inOptionType*

  *the type of this option*

- *inRequired*

  *true if option is required*

- *ppNext*

  *the linked list header*

### virtual CommandOptionWithArg::~CommandOptionWithArg ()` [virtual]`

## MEMBER FUNCTION DOCUMENTATION

### virtual void CommandOptionWithArg::foundOption (CommandOptionParse \* cop, const char \*\* value, int num)` [virtual]`

*Reimplemented from* **CommandOption***.*

### virtual void CommandOptionWithArg::foundOption (CommandOptionParse \* cop, const char \* value = 0)` [virtual]`

*Reimplemented from* **CommandOption***.*

### virtual bool CommandOptionWithArg::hasValue ()` [virtual]`

*Reimplemented from* **CommandOption***.*

## MEMBER DATA DOCUMENTATION

### int CommandOptionWithArg::numValue

**Number** *of values in the values array.*

### const char\*\* CommandOptionWithArg::values

*Array of list of values collected for this option.*

## AUTHOR

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