pub struct Asked<'a> {
pub command: &'a str,
pub position: usize,
pub ask: &'a [&'a str],
}Expand description
The values of positional position of subcommand command are the lines the program prints
when it is run with the arguments ask.
The completions run <program> <ask...> at completion time, in the user’s current folder,
with its error output discarded, and offer each line it prints; if it fails, nothing is
offered. This takes precedence over the positional’s enumerated values. The positional must be
declared (an input with Arg::positional(position) scoped to command).
command must be a plain name and every word of ask a plain token (otherwise the generators
refuse with GenerateError::InvalidName), so nothing in it can become shell code.
use argenv_resolve::generate::Asked;
// `tad q <Tab>` offers what `tad statements queries` prints.
let asked = Asked { command: "q", position: 0, ask: &["statements", "queries"] };Fields§
§command: &'a strThe subcommand whose positional is completed (q).
position: usizeWhich positional of that subcommand, from zero.
ask: &'a [&'a str]The arguments the program is run with to list the values (["statements", "queries"]).
Must not be empty.