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

Handle for a registered option. More...

#include <kaycxx/cli/option_handle.hpp>

Public Member Functions

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

Friends

class command
 

Detailed Description

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

Handle for a registered 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>
option_handle kaycxx::cli::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>
option_handle kaycxx::cli::option_handle< T >::default_value ( T  value)
inline

Sets the default option value.

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::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: