The completion script for shell, to be saved where that shell loads completions from. The
program name is argv[0]'s basename unless program says otherwise.
Args :: #import "Extensions/Args";
Cli :: struct { verbose: bool; @short=v }
HELP :: Args.Help(Cli).{ verbose = "Talk more" };
script := Args.completions(Cli, HELP, .BASH, "tool");
assert(script.count > 0);- $T: the struct whose fields are the options.
- $help: the help strings for
T. - shell: the shell to write the script for.
- program: the command name to complete; "" uses argv[0]'s basename.
completions :: ($T: Type, $help: Help(T), shell: Shell, program := "") -> string
The completion script for shell, to be saved where that shell loads completions from. The
program name is argv[0]'s basename unless program says otherwise.
Parameters
- $T: Type
- the struct whose fields are the options.
- $help: Help(T)
- the help strings for
T. - shell: Shell
- the shell to write the script for.
- program := ""
- the command name to complete; "" uses argv[0]'s basename.
Returns
- string
Args :: #import "Extensions/Args";
Cli :: struct { verbose: bool; @short=v }
HELP :: Args.Help(Cli).{ verbose = "Talk more" };
script := Args.completions(Cli, HELP, .BASH, "tool");
assert(script.count > 0);