AnCH Framework 0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
anch::cli::Arg Struct Reference

Argument. More...

#include <arg.hpp>

Collaboration diagram for anch::cli::Arg:

Public Attributes

std::function< void(const std::string &)> handler
char sopt = '\0'
std::optional< std::string > lopt = std::optional<std::string>()
bool value = false
std::optional< std::string > name = std::optional<std::string>()
bool mandatory = false
bool multi = false
std::function< void(std::istream &)> pipe = std::function<void(std::istream&)>()
std::optional< std::string > description = std::optional<std::string>()
std::optional< std::string > example = std::optional<std::string>()

Detailed Description

Argument.

Argument structure

Since
0.1
Author
Vincent Lachenal

Member Data Documentation

◆ description

std::optional<std::string> anch::cli::Arg::description = std::optional<std::string>()

Description

◆ example

std::optional<std::string> anch::cli::Arg::example = std::optional<std::string>()

Example

◆ handler

std::function<void(const std::string&)> anch::cli::Arg::handler

Argument function handler

◆ lopt

std::optional<std::string> anch::cli::Arg::lopt = std::optional<std::string>()

Long option (starts with '–' and use '=' for value)

◆ mandatory

bool anch::cli::Arg::mandatory = false

Mandatory argument flag (default to false )

◆ multi

bool anch::cli::Arg::multi = false

Multiple occurence argument flag (default to false )

◆ name

std::optional<std::string> anch::cli::Arg::name = std::optional<std::string>()

Value name in help

◆ pipe

std::function<void(std::istream&)> anch::cli::Arg::pipe = std::function<void(std::istream&)>()

Input stream setter (mandatory with pipe option ; default not set)

◆ sopt

char anch::cli::Arg::sopt = '\0'

Short option (starts with '-' and have only one character)

◆ value

bool anch::cli::Arg::value = false

Consume next CLI arguments


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