---
title: "ClikaRT::cli::Args"
sidebar_label: "Args"
description: "The parsed result. Typed reads re-parse the retained token, so the read type is independent of how the option was declared; a wrong-category read returns a failure Result. Owns its state; move-only."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--class">class</span>

**Header:** `ClikaRT/cli/arg.h`

The parsed result. Typed reads re-parse the retained token, so the read type is independent of how the option was declared; a wrong-category read returns a failure [`Result`](../Result.md). Owns its state; move-only. Valid while the owning [`App`](./App.md) lives (it references the matched command).

## Member functions

### Args(Args) {#Args}

<div class="api-signature">

**`Args`**(`Args&&`) `noexcept`

</div>

Move-only: transfers the parse result.

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 153

</div>

### operator=(Args) {#operator-assign}

<div class="api-signature">

[`Args`](./Args.md)`&` **`operator=`**([`Args`](./Args.md)`&&`) `noexcept`

</div>

Move-assign: transfers the parse result.

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 155

</div>

### Args(Args) {#Args-2}

<div class="api-signature">

**`Args`**(`const Args&`) `=delete`

</div>

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 156

</div>

### operator=(Args) {#operator-assign-2}

<div class="api-signature">

[`Args`](./Args.md)`&` **`operator=`**(`const` [`Args`](./Args.md)`&`) `=delete`

</div>

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 157

</div>

### \~Args() {#Args-3}

<div class="api-signature">

**`~Args`**()

</div>

Releases the parse result.

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 159

</div>

### get\_string() {#get_string}

<div class="api-signature">

`std::string` **`get_string`**(`std::string_view` `name`) `const`

</div>

The option's value as text (a repeated option reads its LAST value; [`get_strings`](./Args.md#get_strings) reads them all).

**Throws**

- `ClikaRT::Error`: when the option is unknown or produced no value (guard with [`has`](./Args.md#has)).

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 165

</div>

### get\_int() {#get_int}

<div class="api-signature">

`std::int64_t` **`get_int`**(`std::string_view` `name`) `const`

</div>

The value re-parsed as a signed 64-bit integer.

**Throws**

- `ClikaRT::Error`: when the option is unknown, produced no value, or its text does not parse as an integer.

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 170

</div>

### get\_float() {#get_float}

<div class="api-signature">

`double` **`get_float`**(`std::string_view` `name`) `const`

</div>

The value re-parsed as a `double`.

**Throws**

- `ClikaRT::Error`: when the option is unknown, produced no value, or its text does not parse as a number.

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 175

</div>

### get\_bool() {#get_bool}

<div class="api-signature">

`bool` **`get_bool`**(`std::string_view` `name`) `const`

</div>

The value re-parsed as a boolean.

**Throws**

- `ClikaRT::Error`: when the option is unknown, produced no value, or its text does not parse as a boolean.

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 179

</div>

### get\_strings() {#get_strings}

<div class="api-signature">

`std::vector<std::string>` **`get_strings`**(`std::string_view` `name`) `const`

</div>

Every value of a `.multiple()` (repeated) or `.delimiter()` (comma-split) option, in order, where [`get_string`](./Args.md#get_string) reads only the last. A flag yields `{"1"}`. Raises [`ClikaRT::Error`](../Error.md) if the option is unknown or was not provided (guard with `has(name)`).

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 186

</div>

### has() {#has}

<div class="api-signature">

`bool` **`has`**(`std::string_view` `name`) `const`

</div>

Declared AND produced a value (from argv, env, or default).

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 191

</div>

### count() {#count}

<div class="api-signature">

`std::size_t` **`count`**(`std::string_view` `name`) `const`

</div>

Times the option occurred on the command line (0 if unknown).

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 193

</div>

### subcommand() {#subcommand}

<div class="api-signature">

`std::string` **`subcommand`**() `const`

</div>

The subcommand that ran (empty for the root) and the full chain to it.

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 196

</div>

### subcommand\_path() {#subcommand_path}

<div class="api-signature">

`std::vector<std::string>` **`subcommand_path`**() `const`

</div>

The full subcommand chain, outermost first (empty at the root).

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 198

</div>

### unknown() {#unknown}

<div class="api-signature">

`std::vector<std::string>` **`unknown`**() `const`

</div>

unrecognized tokens (with allow\_unknown)

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 200

</div>

### remaining() {#remaining}

<div class="api-signature">

`std::vector<std::string>` **`remaining`**() `const`

</div>

verbatim tokens after a lone `--`

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 201

</div>

### help\_requested() {#help_requested}

<div class="api-signature">

`bool` **`help_requested`**() `const`

</div>

True when help was requested (`--help`).

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 204

</div>

### version\_requested() {#version_requested}

<div class="api-signature">

`bool` **`version_requested`**() `const`

</div>

True when the version was requested (`--version`).

<div class="api-declared">

Declared in `ClikaRT/cli/arg.h`, line 206

</div>
