htils 1
A small set of utilities for C programming.
Loading...
Searching...
No Matches
cli Struct Reference

The cli state thats used during parsing. More...

#include <cli.h>

Data Fields

i64 argc
 
cstr ** argv
 
stringcli_name
 
stringcli_desc
 
htils_cli_option_t ** options
 
arena_tarena
 
void(* usage )(struct cli *cli, cstr **argv)
 
i64 optidx
 
i16 next_char
 
cstroptarg
 
i16 optopt
 

Detailed Description

The cli state thats used during parsing.

Parameters
argcThe number of arguments
argvThe arguments
cli_nameThe name of the cli
cli_descThe description of the cli
optionsThe options of the cli
arenaThe arena to use for allocating memory in the cli parser.
usageThe usage function to use when printing the usage of the cli.
optidxThe index of the current option being parsed.
next_charThe next character to parse.
optargThe argument of the current option being parsed.
optoptThe option of the current option being parsed.

Field Documentation

◆ arena

arena_t* cli::arena

◆ argc

i64 cli::argc

◆ argv

cstr** cli::argv

◆ cli_desc

string* cli::cli_desc

◆ cli_name

string* cli::cli_name

◆ next_char

i16 cli::next_char

◆ optarg

cstr* cli::optarg

◆ optidx

i64 cli::optidx

◆ options

htils_cli_option_t** cli::options

◆ optopt

i16 cli::optopt

◆ usage

void(* cli::usage) (struct cli *cli, cstr **argv)

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