The help text of the whole program (what --help prints), for tools that show it themselves.
Args :: #import "Extensions/Args";
Cli :: struct { verbose: bool; @short=v }
HELP :: Args.Help(Cli).{ about = "Does things.", verbose = "Talk more" };
text := Args.help_text(Cli, HELP, "tool");
assert(text.count > 0);- $T: the struct whose fields are the options.
- $help: the help strings for
T. - program: the name shown in the usage line; "" uses argv[0]'s basename.
- color: whether to include ANSI colour codes.
help_text :: ($T: Type, $help: Help(T), program := "", color := false) -> string
The help text of the whole program (what --help prints), for tools that show it themselves.
Parameters
- $T: Type
- the struct whose fields are the options.
- $help: Help(T)
- the help strings for
T. - program := ""
- the name shown in the usage line; "" uses argv[0]'s basename.
- color := false
- whether to include ANSI colour codes.
Returns
- string
Args :: #import "Extensions/Args";
Cli :: struct { verbose: bool; @short=v }
HELP :: Args.Help(Cli).{ about = "Does things.", verbose = "Talk more" };
text := Args.help_text(Cli, HELP, "tool");
assert(text.count > 0);