kaycxx-cli
C++ CLI library
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
kaycxx::cli::repeatable_option_handle< T > Class Template Reference

Handle for a registered repeatable option. More...

#include <kaycxx/cli/repeatable_option_handle.hpp>

Public Member Functions

repeatable_option_handle action () noexcept
 Marks the option as a mutually exclusive command action.
 
option< T > constdefinition () const noexcept
 Returns the underlying option definition.
 
repeatable_option_handle default_value (T value)
 Sets a default option value.
 

Friends

class command
 

Detailed Description

template<parseable_value T>
class kaycxx::cli::repeatable_option_handle< T >

Handle for a registered repeatable option.

The handle does not own the option definition. It references data owned by the command that created it.

Template Parameters
TOption value type.

Member Function Documentation

◆ action()

template<parseable_value T>
repeatable_option_handle kaycxx::cli::repeatable_option_handle< T >::action ( )
inlinenoexcept

Marks the option as a mutually exclusive command action.

Returns
This handle for chaining.

◆ default_value()

template<parseable_value T>
repeatable_option_handle kaycxx::cli::repeatable_option_handle< T >::default_value ( T  value)
inline

Sets a default option value.

When the option is absent, the value is returned as the only element of its result vector.

Parameters
valueDefault value used when the option is not present in parsed arguments.
Returns
This handle for chaining.

◆ definition()

template<parseable_value T>
option< T > const & kaycxx::cli::repeatable_option_handle< T >::definition ( ) const
inlinenoexcept

Returns the underlying option definition.

Returns
Option definition owned by the command.

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