Merge pull request #5049 from epage/dyn

test(complete): Unblock E2E dynamic completion tests
This commit is contained in:
Ed Page 2023-07-28 15:15:43 -05:00 committed by GitHub
commit a3d93f485f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 681 additions and 529 deletions

View file

@ -1,3 +1,5 @@
#[cfg(feature = "unstable-dynamic")]
use clap::{FromArgMatches, Subcommand};
use clap_complete::{generate, Generator, Shell};
fn main() {
@ -6,17 +8,27 @@ fn main() {
let mut cmd = cli();
eprintln!("Generating completion file for {generator}...");
print_completions(*generator, &mut cmd);
} else {
println!("{:?}", matches);
return;
}
#[cfg(feature = "unstable-dynamic")]
if let Ok(completions) =
clap_complete::dynamic::shells::CompleteCommand::from_arg_matches(&matches)
{
completions.complete(&mut cli());
return;
};
println!("{:?}", matches);
}
fn print_completions<G: Generator>(gen: G, cmd: &mut clap::Command) {
generate(gen, cmd, cmd.get_name().to_string(), &mut std::io::stdout());
}
#[allow(clippy::let_and_return)]
fn cli() -> clap::Command {
clap::Command::new("test")
let cli = clap::Command::new("exhaustive")
.version("3.0")
.propagate_version(true)
.args([
@ -27,6 +39,7 @@ fn cli() -> clap::Command {
.help("everywhere"),
clap::Arg::new("generate")
.long("generate")
.value_name("SHELL")
.value_parser(clap::value_parser!(Shell))
.help("generate"),
])
@ -173,5 +186,8 @@ fn cli() -> clap::Command {
.long("email")
.value_hint(clap::ValueHint::EmailAddress),
]),
])
]);
#[cfg(feature = "unstable-dynamic")]
let cli = clap_complete::dynamic::shells::CompleteCommand::augment_subcommands(cli);
cli
}

View file

@ -133,12 +133,17 @@ fn complete_arg(
}
if arg.is_empty() || arg.is_stdio() || arg.is_short() {
let dash_or_arg = if arg.is_empty() {
"-".into()
} else {
arg.to_value_os().to_string_lossy()
};
// HACK: Assuming knowledge of is_stdio
completions.extend(
crate::generator::utils::shorts_and_visible_aliases(cmd)
.into_iter()
// HACK: Need better `OsStr` manipulation
.map(|f| format!("{}{}", arg.to_value_os().to_string_lossy(), f).into()),
.map(|f| format!("{}{}", dash_or_arg, f).into()),
);
}
}
@ -270,7 +275,7 @@ fn complete_subcommand(value: &str, cmd: &clap::Command) -> Vec<OsString> {
value
);
let mut scs = crate::generator::utils::all_subcommands(cmd)
let mut scs = crate::generator::utils::subcommands(cmd)
.into_iter()
.filter(|x| x.0.starts_with(value))
.map(|x| OsString::from(&x.0))

View file

@ -27,6 +27,7 @@ impl crate::dynamic::Completer for Bash {
let script = r#"
_clap_complete_NAME() {
export IFS=$'\013'
export _CLAP_COMPLETE_INDEX=${COMP_CWORD}
export _CLAP_COMPLETE_COMP_TYPE=${COMP_TYPE}
if compopt +o nospace 2> /dev/null; then
@ -34,7 +35,6 @@ _clap_complete_NAME() {
else
export _CLAP_COMPLETE_SPACE=true
fi
export _CLAP_COMPLETE_IFS=$'\013'
COMPREPLY=( $("COMPLETER" complete --shell bash -- "${COMP_WORDS[@]}") )
if [[ $? != 0 ]]; then
unset COMPREPLY
@ -70,9 +70,7 @@ complete -o nospace -o bashdefault -F _clap_complete_NAME BIN
let _space: Option<bool> = std::env::var("_CLAP_COMPLETE_SPACE")
.ok()
.and_then(|i| i.parse().ok());
let ifs: Option<String> = std::env::var("_CLAP_COMPLETE_IFS")
.ok()
.and_then(|i| i.parse().ok());
let ifs: Option<String> = std::env::var("IFS").ok().and_then(|i| i.parse().ok());
let completions = crate::dynamic::complete(cmd, args, index, current_dir)?;
for (i, completion) in completions.iter().enumerate() {

View file

@ -0,0 +1,22 @@
PS1='% '
. /etc/bash_completion
_clap_complete_exhaustive() {
export IFS=$'\013'
export _CLAP_COMPLETE_INDEX=${COMP_CWORD}
export _CLAP_COMPLETE_COMP_TYPE=${COMP_TYPE}
if compopt +o nospace 2> /dev/null; then
export _CLAP_COMPLETE_SPACE=false
else
export _CLAP_COMPLETE_SPACE=true
fi
COMPREPLY=( $("exhaustive" complete --shell bash -- "${COMP_WORDS[@]}") )
if [[ $? != 0 ]]; then
unset COMPREPLY
elif [[ $SUPPRESS_SPACE == 1 ]] && [[ "${COMPREPLY-}" =~ [=/:]$ ]]; then
compopt -o nospace
fi
}
complete -o nospace -o bashdefault -F _clap_complete_exhaustive exhaustive

View file

@ -1,6 +1,6 @@
PS1='% '
. /etc/bash_completion
_test() {
_exhaustive() {
local i cur prev opts cmd
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
@ -12,139 +12,145 @@ _test() {
do
case "${cmd},${i}" in
",$1")
cmd="test"
cmd="exhaustive"
;;
test,action)
cmd="test__action"
exhaustive,action)
cmd="exhaustive__action"
;;
test,alias)
cmd="test__alias"
exhaustive,alias)
cmd="exhaustive__alias"
;;
test,help)
cmd="test__help"
exhaustive,complete)
cmd="exhaustive__complete"
;;
test,hint)
cmd="test__hint"
exhaustive,help)
cmd="exhaustive__help"
;;
test,last)
cmd="test__last"
exhaustive,hint)
cmd="exhaustive__hint"
;;
test,pacman)
cmd="test__pacman"
exhaustive,last)
cmd="exhaustive__last"
;;
test,quote)
cmd="test__quote"
exhaustive,pacman)
cmd="exhaustive__pacman"
;;
test,value)
cmd="test__value"
exhaustive,quote)
cmd="exhaustive__quote"
;;
test__help,action)
cmd="test__help__action"
exhaustive,value)
cmd="exhaustive__value"
;;
test__help,alias)
cmd="test__help__alias"
exhaustive__help,action)
cmd="exhaustive__help__action"
;;
test__help,help)
cmd="test__help__help"
exhaustive__help,alias)
cmd="exhaustive__help__alias"
;;
test__help,hint)
cmd="test__help__hint"
exhaustive__help,complete)
cmd="exhaustive__help__complete"
;;
test__help,last)
cmd="test__help__last"
exhaustive__help,help)
cmd="exhaustive__help__help"
;;
test__help,pacman)
cmd="test__help__pacman"
exhaustive__help,hint)
cmd="exhaustive__help__hint"
;;
test__help,quote)
cmd="test__help__quote"
exhaustive__help,last)
cmd="exhaustive__help__last"
;;
test__help,value)
cmd="test__help__value"
exhaustive__help,pacman)
cmd="exhaustive__help__pacman"
;;
test__help__pacman,one)
cmd="test__help__pacman__one"
exhaustive__help,quote)
cmd="exhaustive__help__quote"
;;
test__help__pacman,two)
cmd="test__help__pacman__two"
exhaustive__help,value)
cmd="exhaustive__help__value"
;;
test__help__quote,cmd-backslash)
cmd="test__help__quote__cmd__backslash"
exhaustive__help__pacman,one)
cmd="exhaustive__help__pacman__one"
;;
test__help__quote,cmd-backticks)
cmd="test__help__quote__cmd__backticks"
exhaustive__help__pacman,two)
cmd="exhaustive__help__pacman__two"
;;
test__help__quote,cmd-brackets)
cmd="test__help__quote__cmd__brackets"
exhaustive__help__quote,cmd-backslash)
cmd="exhaustive__help__quote__cmd__backslash"
;;
test__help__quote,cmd-double-quotes)
cmd="test__help__quote__cmd__double__quotes"
exhaustive__help__quote,cmd-backticks)
cmd="exhaustive__help__quote__cmd__backticks"
;;
test__help__quote,cmd-expansions)
cmd="test__help__quote__cmd__expansions"
exhaustive__help__quote,cmd-brackets)
cmd="exhaustive__help__quote__cmd__brackets"
;;
test__help__quote,cmd-single-quotes)
cmd="test__help__quote__cmd__single__quotes"
exhaustive__help__quote,cmd-double-quotes)
cmd="exhaustive__help__quote__cmd__double__quotes"
;;
test__pacman,help)
cmd="test__pacman__help"
exhaustive__help__quote,cmd-expansions)
cmd="exhaustive__help__quote__cmd__expansions"
;;
test__pacman,one)
cmd="test__pacman__one"
exhaustive__help__quote,cmd-single-quotes)
cmd="exhaustive__help__quote__cmd__single__quotes"
;;
test__pacman,two)
cmd="test__pacman__two"
exhaustive__pacman,help)
cmd="exhaustive__pacman__help"
;;
test__pacman__help,help)
cmd="test__pacman__help__help"
exhaustive__pacman,one)
cmd="exhaustive__pacman__one"
;;
test__pacman__help,one)
cmd="test__pacman__help__one"
exhaustive__pacman,two)
cmd="exhaustive__pacman__two"
;;
test__pacman__help,two)
cmd="test__pacman__help__two"
exhaustive__pacman__help,help)
cmd="exhaustive__pacman__help__help"
;;
test__quote,cmd-backslash)
cmd="test__quote__cmd__backslash"
exhaustive__pacman__help,one)
cmd="exhaustive__pacman__help__one"
;;
test__quote,cmd-backticks)
cmd="test__quote__cmd__backticks"
exhaustive__pacman__help,two)
cmd="exhaustive__pacman__help__two"
;;
test__quote,cmd-brackets)
cmd="test__quote__cmd__brackets"
exhaustive__quote,cmd-backslash)
cmd="exhaustive__quote__cmd__backslash"
;;
test__quote,cmd-double-quotes)
cmd="test__quote__cmd__double__quotes"
exhaustive__quote,cmd-backticks)
cmd="exhaustive__quote__cmd__backticks"
;;
test__quote,cmd-expansions)
cmd="test__quote__cmd__expansions"
exhaustive__quote,cmd-brackets)
cmd="exhaustive__quote__cmd__brackets"
;;
test__quote,cmd-single-quotes)
cmd="test__quote__cmd__single__quotes"
exhaustive__quote,cmd-double-quotes)
cmd="exhaustive__quote__cmd__double__quotes"
;;
test__quote,help)
cmd="test__quote__help"
exhaustive__quote,cmd-expansions)
cmd="exhaustive__quote__cmd__expansions"
;;
test__quote__help,cmd-backslash)
cmd="test__quote__help__cmd__backslash"
exhaustive__quote,cmd-single-quotes)
cmd="exhaustive__quote__cmd__single__quotes"
;;
test__quote__help,cmd-backticks)
cmd="test__quote__help__cmd__backticks"
exhaustive__quote,help)
cmd="exhaustive__quote__help"
;;
test__quote__help,cmd-brackets)
cmd="test__quote__help__cmd__brackets"
exhaustive__quote__help,cmd-backslash)
cmd="exhaustive__quote__help__cmd__backslash"
;;
test__quote__help,cmd-double-quotes)
cmd="test__quote__help__cmd__double__quotes"
exhaustive__quote__help,cmd-backticks)
cmd="exhaustive__quote__help__cmd__backticks"
;;
test__quote__help,cmd-expansions)
cmd="test__quote__help__cmd__expansions"
exhaustive__quote__help,cmd-brackets)
cmd="exhaustive__quote__help__cmd__brackets"
;;
test__quote__help,cmd-single-quotes)
cmd="test__quote__help__cmd__single__quotes"
exhaustive__quote__help,cmd-double-quotes)
cmd="exhaustive__quote__help__cmd__double__quotes"
;;
test__quote__help,help)
cmd="test__quote__help__help"
exhaustive__quote__help,cmd-expansions)
cmd="exhaustive__quote__help__cmd__expansions"
;;
exhaustive__quote__help,cmd-single-quotes)
cmd="exhaustive__quote__help__cmd__single__quotes"
;;
exhaustive__quote__help,help)
cmd="exhaustive__quote__help__help"
;;
*)
;;
@ -152,8 +158,8 @@ _test() {
done
case "${cmd}" in
test)
opts="-h -V --global --generate --help --version action quote value pacman last alias hint help"
exhaustive)
opts="-h -V --global --generate --help --version action quote value pacman last alias hint complete help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@ -170,7 +176,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__action)
exhaustive__action)
opts="-h -V --set-true --set --count --choice --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -192,7 +198,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__alias)
exhaustive__alias)
opts="-F -f -O -o -h -V --flg --flag --opt --option --global --help --version [positional]"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -222,8 +228,30 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help)
opts="action quote value pacman last alias hint help"
exhaustive__complete)
opts="-h -V --shell --register --global --help --version [COMP_WORDS]..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--shell)
COMPREPLY=($(compgen -W "bash" -- "${cur}"))
return 0
;;
--register)
COMPREPLY=($(compgen -f "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
exhaustive__help)
opts="action quote value pacman last alias hint complete help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@ -236,7 +264,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__action)
exhaustive__help__action)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -250,7 +278,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__alias)
exhaustive__help__alias)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -264,7 +292,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__help)
exhaustive__help__complete)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -278,7 +306,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__hint)
exhaustive__help__help)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -292,7 +320,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__last)
exhaustive__help__hint)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -306,7 +334,21 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__pacman)
exhaustive__help__last)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
exhaustive__help__pacman)
opts="one two"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -320,7 +362,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__pacman__one)
exhaustive__help__pacman__one)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -334,7 +376,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__pacman__two)
exhaustive__help__pacman__two)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -348,7 +390,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__quote)
exhaustive__help__quote)
opts="cmd-single-quotes cmd-double-quotes cmd-backticks cmd-backslash cmd-brackets cmd-expansions"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -362,7 +404,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__quote__cmd__backslash)
exhaustive__help__quote__cmd__backslash)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -376,7 +418,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__quote__cmd__backticks)
exhaustive__help__quote__cmd__backticks)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -390,7 +432,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__quote__cmd__brackets)
exhaustive__help__quote__cmd__brackets)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -404,7 +446,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__quote__cmd__double__quotes)
exhaustive__help__quote__cmd__double__quotes)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -418,7 +460,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__quote__cmd__expansions)
exhaustive__help__quote__cmd__expansions)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -432,7 +474,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__quote__cmd__single__quotes)
exhaustive__help__quote__cmd__single__quotes)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -446,7 +488,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__help__value)
exhaustive__help__value)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -460,7 +502,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__hint)
exhaustive__hint)
opts="-p -f -d -e -c -u -H -h -V --choice --unknown --other --path --file --dir --exe --cmd-name --cmd --user --host --url --email --global --help --version [command_with_args]..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -554,7 +596,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__last)
exhaustive__last)
opts="-h -V --global --help --version [first] [free]"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -568,7 +610,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__pacman)
exhaustive__pacman)
opts="-h -V --global --help --version one two help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -582,7 +624,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__pacman__help)
exhaustive__pacman__help)
opts="one two help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -596,7 +638,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__pacman__help__help)
exhaustive__pacman__help__help)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -610,7 +652,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__pacman__help__one)
exhaustive__pacman__help__one)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -624,7 +666,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__pacman__help__two)
exhaustive__pacman__help__two)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -638,7 +680,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__pacman__one)
exhaustive__pacman__one)
opts="-h -V --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -652,7 +694,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__pacman__two)
exhaustive__pacman__two)
opts="-h -V --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -666,7 +708,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote)
exhaustive__quote)
opts="-h -V --single-quotes --double-quotes --backticks --backslash --brackets --expansions --global --help --version cmd-single-quotes cmd-double-quotes cmd-backticks cmd-backslash cmd-brackets cmd-expansions help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -680,7 +722,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__cmd__backslash)
exhaustive__quote__cmd__backslash)
opts="-h -V --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -694,7 +736,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__cmd__backticks)
exhaustive__quote__cmd__backticks)
opts="-h -V --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -708,7 +750,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__cmd__brackets)
exhaustive__quote__cmd__brackets)
opts="-h -V --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -722,7 +764,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__cmd__double__quotes)
exhaustive__quote__cmd__double__quotes)
opts="-h -V --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -736,7 +778,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__cmd__expansions)
exhaustive__quote__cmd__expansions)
opts="-h -V --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -750,7 +792,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__cmd__single__quotes)
exhaustive__quote__cmd__single__quotes)
opts="-h -V --global --help --version"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -764,7 +806,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__help)
exhaustive__quote__help)
opts="cmd-single-quotes cmd-double-quotes cmd-backticks cmd-backslash cmd-brackets cmd-expansions help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 3 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -778,7 +820,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__help__cmd__backslash)
exhaustive__quote__help__cmd__backslash)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -792,7 +834,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__help__cmd__backticks)
exhaustive__quote__help__cmd__backticks)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -806,7 +848,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__help__cmd__brackets)
exhaustive__quote__help__cmd__brackets)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -820,7 +862,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__help__cmd__double__quotes)
exhaustive__quote__help__cmd__double__quotes)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -834,7 +876,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__help__cmd__expansions)
exhaustive__quote__help__cmd__expansions)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -848,7 +890,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__help__cmd__single__quotes)
exhaustive__quote__help__cmd__single__quotes)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -862,7 +904,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__quote__help__help)
exhaustive__quote__help__help)
opts=""
if [[ ${cur} == -* || ${COMP_CWORD} -eq 4 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -876,7 +918,7 @@ _test() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
test__value)
exhaustive__value)
opts="-h -V --delim --tuple --require-eq --global --help --version [term]..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
@ -905,5 +947,5 @@ _test() {
esac
}
complete -F _test -o nosort -o bashdefault -o default test
complete -F _exhaustive -o nosort -o bashdefault -o default exhaustive

View file

@ -4,14 +4,14 @@ set edit:prompt = (constantly "% ")
use builtin;
use str;
set edit:completion:arg-completer[test] = {|@words|
set edit:completion:arg-completer[exhaustive] = {|@words|
fn spaces {|n|
builtin:repeat $n ' ' | str:join ''
}
fn cand {|text desc|
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
}
var command = 'test'
var command = 'exhaustive'
for word $words[1..-1] {
if (str:has-prefix $word '-') {
break
@ -19,7 +19,7 @@ set edit:completion:arg-completer[test] = {|@words|
set command = $command';'$word
}
var completions = [
&'test'= {
&'exhaustive'= {
cand --generate 'generate'
cand --global 'everywhere'
cand -h 'Print help'
@ -33,9 +33,10 @@ set edit:completion:arg-completer[test] = {|@words|
cand last 'last'
cand alias 'alias'
cand hint 'hint'
cand complete 'Register shell completions for this program'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'test;action'= {
&'exhaustive;action'= {
cand --set 'value'
cand --choice 'enum'
cand --set-true 'bool'
@ -46,7 +47,7 @@ set edit:completion:arg-completer[test] = {|@words|
cand -V 'Print version'
cand --version 'Print version'
}
&'test;quote'= {
&'exhaustive;quote'= {
cand --single-quotes 'Can be ''always'', ''auto'', or ''never'''
cand --double-quotes 'Can be "always", "auto", or "never"'
cand --backticks 'For more information see `echo test`'
@ -66,49 +67,49 @@ set edit:completion:arg-completer[test] = {|@words|
cand cmd-expansions 'Execute the shell command with $SHELL'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'test;quote;cmd-single-quotes'= {
&'exhaustive;quote;cmd-single-quotes'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;quote;cmd-double-quotes'= {
&'exhaustive;quote;cmd-double-quotes'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;quote;cmd-backticks'= {
&'exhaustive;quote;cmd-backticks'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;quote;cmd-backslash'= {
&'exhaustive;quote;cmd-backslash'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;quote;cmd-brackets'= {
&'exhaustive;quote;cmd-brackets'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;quote;cmd-expansions'= {
&'exhaustive;quote;cmd-expansions'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;quote;help'= {
&'exhaustive;quote;help'= {
cand cmd-single-quotes 'Can be ''always'', ''auto'', or ''never'''
cand cmd-double-quotes 'Can be "always", "auto", or "never"'
cand cmd-backticks 'For more information see `echo test`'
@ -117,21 +118,21 @@ set edit:completion:arg-completer[test] = {|@words|
cand cmd-expansions 'Execute the shell command with $SHELL'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'test;quote;help;cmd-single-quotes'= {
&'exhaustive;quote;help;cmd-single-quotes'= {
}
&'test;quote;help;cmd-double-quotes'= {
&'exhaustive;quote;help;cmd-double-quotes'= {
}
&'test;quote;help;cmd-backticks'= {
&'exhaustive;quote;help;cmd-backticks'= {
}
&'test;quote;help;cmd-backslash'= {
&'exhaustive;quote;help;cmd-backslash'= {
}
&'test;quote;help;cmd-brackets'= {
&'exhaustive;quote;help;cmd-brackets'= {
}
&'test;quote;help;cmd-expansions'= {
&'exhaustive;quote;help;cmd-expansions'= {
}
&'test;quote;help;help'= {
&'exhaustive;quote;help;help'= {
}
&'test;value'= {
&'exhaustive;value'= {
cand --delim 'delim'
cand --tuple 'tuple'
cand --require-eq 'require-eq'
@ -141,7 +142,7 @@ set edit:completion:arg-completer[test] = {|@words|
cand -V 'Print version'
cand --version 'Print version'
}
&'test;pacman'= {
&'exhaustive;pacman'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
@ -151,39 +152,39 @@ set edit:completion:arg-completer[test] = {|@words|
cand two 'two'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'test;pacman;one'= {
&'exhaustive;pacman;one'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;pacman;two'= {
&'exhaustive;pacman;two'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;pacman;help'= {
&'exhaustive;pacman;help'= {
cand one 'one'
cand two 'two'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'test;pacman;help;one'= {
&'exhaustive;pacman;help;one'= {
}
&'test;pacman;help;two'= {
&'exhaustive;pacman;help;two'= {
}
&'test;pacman;help;help'= {
&'exhaustive;pacman;help;help'= {
}
&'test;last'= {
&'exhaustive;last'= {
cand --global 'everywhere'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'test;alias'= {
&'exhaustive;alias'= {
cand -o 'cmd option'
cand -O 'cmd option'
cand --option 'cmd option'
@ -198,7 +199,7 @@ set edit:completion:arg-completer[test] = {|@words|
cand -V 'Print version'
cand --version 'Print version'
}
&'test;hint'= {
&'exhaustive;hint'= {
cand --choice 'choice'
cand --unknown 'unknown'
cand --other 'other'
@ -225,7 +226,16 @@ set edit:completion:arg-completer[test] = {|@words|
cand -V 'Print version'
cand --version 'Print version'
}
&'test;help'= {
&'exhaustive;complete'= {
cand --shell 'Specify shell to complete for'
cand --register 'Path to write completion-registration to'
cand --global 'everywhere'
cand -h 'Print help (see more with ''--help'')'
cand --help 'Print help (see more with ''--help'')'
cand -V 'Print version'
cand --version 'Print version'
}
&'exhaustive;help'= {
cand action 'action'
cand quote 'quote'
cand value 'value'
@ -233,11 +243,12 @@ set edit:completion:arg-completer[test] = {|@words|
cand last 'last'
cand alias 'alias'
cand hint 'hint'
cand complete 'Register shell completions for this program'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'test;help;action'= {
&'exhaustive;help;action'= {
}
&'test;help;quote'= {
&'exhaustive;help;quote'= {
cand cmd-single-quotes 'Can be ''always'', ''auto'', or ''never'''
cand cmd-double-quotes 'Can be "always", "auto", or "never"'
cand cmd-backticks 'For more information see `echo test`'
@ -245,35 +256,37 @@ set edit:completion:arg-completer[test] = {|@words|
cand cmd-brackets 'List packages [filter]'
cand cmd-expansions 'Execute the shell command with $SHELL'
}
&'test;help;quote;cmd-single-quotes'= {
&'exhaustive;help;quote;cmd-single-quotes'= {
}
&'test;help;quote;cmd-double-quotes'= {
&'exhaustive;help;quote;cmd-double-quotes'= {
}
&'test;help;quote;cmd-backticks'= {
&'exhaustive;help;quote;cmd-backticks'= {
}
&'test;help;quote;cmd-backslash'= {
&'exhaustive;help;quote;cmd-backslash'= {
}
&'test;help;quote;cmd-brackets'= {
&'exhaustive;help;quote;cmd-brackets'= {
}
&'test;help;quote;cmd-expansions'= {
&'exhaustive;help;quote;cmd-expansions'= {
}
&'test;help;value'= {
&'exhaustive;help;value'= {
}
&'test;help;pacman'= {
&'exhaustive;help;pacman'= {
cand one 'one'
cand two 'two'
}
&'test;help;pacman;one'= {
&'exhaustive;help;pacman;one'= {
}
&'test;help;pacman;two'= {
&'exhaustive;help;pacman;two'= {
}
&'test;help;last'= {
&'exhaustive;help;last'= {
}
&'test;help;alias'= {
&'exhaustive;help;alias'= {
}
&'test;help;hint'= {
&'exhaustive;help;hint'= {
}
&'test;help;help'= {
&'exhaustive;help;complete'= {
}
&'exhaustive;help;help'= {
}
]
$completions[$command]

View file

@ -0,0 +1,128 @@
complete -c exhaustive -n "__fish_use_subcommand" -l generate -d 'generate' -r -f -a "{bash ,elvish ,fish ,powershell ,zsh }"
complete -c exhaustive -n "__fish_use_subcommand" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_use_subcommand" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_use_subcommand" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_use_subcommand" -f -a "action"
complete -c exhaustive -n "__fish_use_subcommand" -f -a "quote"
complete -c exhaustive -n "__fish_use_subcommand" -f -a "value"
complete -c exhaustive -n "__fish_use_subcommand" -f -a "pacman"
complete -c exhaustive -n "__fish_use_subcommand" -f -a "last"
complete -c exhaustive -n "__fish_use_subcommand" -f -a "alias"
complete -c exhaustive -n "__fish_use_subcommand" -f -a "hint"
complete -c exhaustive -n "__fish_use_subcommand" -f -a "complete" -d 'Register shell completions for this program'
complete -c exhaustive -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c exhaustive -n "__fish_seen_subcommand_from action" -l set -d 'value' -r
complete -c exhaustive -n "__fish_seen_subcommand_from action" -l choice -d 'enum' -r -f -a "{first ,second }"
complete -c exhaustive -n "__fish_seen_subcommand_from action" -l set-true -d 'bool'
complete -c exhaustive -n "__fish_seen_subcommand_from action" -l count -d 'number'
complete -c exhaustive -n "__fish_seen_subcommand_from action" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from action" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from action" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l single-quotes -d 'Can be \'always\', \'auto\', or \'never\''
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l double-quotes -d 'Can be "always", "auto", or "never"'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l backticks -d 'For more information see `echo test`'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l backslash -d 'Avoid \'\\n\''
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l brackets -d 'List packages [filter]'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l expansions -d 'Execute the shell command with $SHELL'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-single-quotes" -d 'Can be \'always\', \'auto\', or \'never\''
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-double-quotes" -d 'Can be "always", "auto", or "never"'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backticks" -d 'For more information see `echo test`'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backslash" -d 'Avoid \'\\n\''
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-brackets" -d 'List packages [filter]'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-expansions" -d 'Execute the shell command with $SHELL'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-single-quotes" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-single-quotes" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-single-quotes" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-double-quotes" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-double-quotes" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-double-quotes" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backticks" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backticks" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backticks" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backslash" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backslash" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backslash" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-brackets" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-brackets" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-brackets" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-expansions" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-expansions" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-expansions" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-single-quotes" -d 'Can be \'always\', \'auto\', or \'never\''
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-double-quotes" -d 'Can be "always", "auto", or "never"'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backticks" -d 'For more information see `echo test`'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backslash" -d 'Avoid \'\\n\''
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-brackets" -d 'List packages [filter]'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-expansions" -d 'Execute the shell command with $SHELL'
complete -c exhaustive -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c exhaustive -n "__fish_seen_subcommand_from value" -l delim -r
complete -c exhaustive -n "__fish_seen_subcommand_from value" -l tuple -r
complete -c exhaustive -n "__fish_seen_subcommand_from value" -l require-eq -r
complete -c exhaustive -n "__fish_seen_subcommand_from value" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from value" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from value" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "one"
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "two"
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from one" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from one" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from one" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from two" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from two" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from two" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "one"
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "two"
complete -c exhaustive -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c exhaustive -n "__fish_seen_subcommand_from last" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from last" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from last" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from alias" -s o -s O -l option -l opt -d 'cmd option' -r
complete -c exhaustive -n "__fish_seen_subcommand_from alias" -s f -s F -l flag -l flg -d 'cmd flag'
complete -c exhaustive -n "__fish_seen_subcommand_from alias" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from alias" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from alias" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -l choice -r -f -a "{bash ,fish ,zsh }"
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -l unknown -r
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -l other -r -f
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s p -l path -r -F
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s f -l file -r -F
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s d -l dir -r -f -a "(__fish_complete_directories)"
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s e -l exe -r -F
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -l cmd-name -r -f -a "(__fish_complete_command)"
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s c -l cmd -r -f -a "(__fish_complete_command)"
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s u -l user -r -f -a "(__fish_complete_users)"
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s H -l host -r -f -a "(__fish_print_hostnames)"
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -l url -r -f
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -l email -r -f
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s h -l help -d 'Print help'
complete -c exhaustive -n "__fish_seen_subcommand_from hint" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from complete" -l shell -d 'Specify shell to complete for' -r -f -a "{bash }"
complete -c exhaustive -n "__fish_seen_subcommand_from complete" -l register -d 'Path to write completion-registration to' -r -F
complete -c exhaustive -n "__fish_seen_subcommand_from complete" -l global -d 'everywhere'
complete -c exhaustive -n "__fish_seen_subcommand_from complete" -s h -l help -d 'Print help (see more with \'--help\')'
complete -c exhaustive -n "__fish_seen_subcommand_from complete" -s V -l version -d 'Print version'
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "action"
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "quote"
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "value"
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "pacman"
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "last"
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "alias"
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "hint"
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "complete" -d 'Register shell completions for this program'
complete -c exhaustive -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from complete; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c exhaustive -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-single-quotes" -d 'Can be \'always\', \'auto\', or \'never\''
complete -c exhaustive -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-double-quotes" -d 'Can be "always", "auto", or "never"'
complete -c exhaustive -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-backticks" -d 'For more information see `echo test`'
complete -c exhaustive -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-backslash" -d 'Avoid \'\\n\''
complete -c exhaustive -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-brackets" -d 'List packages [filter]'
complete -c exhaustive -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-expansions" -d 'Execute the shell command with $SHELL'
complete -c exhaustive -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two" -f -a "one"
complete -c exhaustive -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two" -f -a "two"

View file

@ -1,8 +1,8 @@
#compdef test
#compdef exhaustive
autoload -U is-at-least
_test() {
_exhaustive() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
@ -15,20 +15,20 @@ _test() {
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \
'--generate=[generate]: :(bash elvish fish powershell zsh)' \
'--generate=[generate]:SHELL:(bash elvish fish powershell zsh)' \
'--global[everywhere]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_test_commands" \
"*::: :->test" \
":: :_exhaustive_commands" \
"*::: :->exhaustive" \
&& ret=0
case $state in
(test)
(exhaustive)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:test-command-$line[1]:"
curcontext="${curcontext%:*:*}:exhaustive-command-$line[1]:"
case $line[1] in
(action)
_arguments "${_arguments_options[@]}" \
@ -56,7 +56,7 @@ _arguments "${_arguments_options[@]}" \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_test__quote_commands" \
":: :_exhaustive__quote_commands" \
"*::: :->quote" \
&& ret=0
@ -64,7 +64,7 @@ _arguments "${_arguments_options[@]}" \
(quote)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:test-quote-command-$line[1]:"
curcontext="${curcontext%:*:*}:exhaustive-quote-command-$line[1]:"
case $line[1] in
(cmd-single-quotes)
_arguments "${_arguments_options[@]}" \
@ -122,7 +122,7 @@ _arguments "${_arguments_options[@]}" \
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_test__quote__help_commands" \
":: :_exhaustive__quote__help_commands" \
"*::: :->help" \
&& ret=0
@ -130,7 +130,7 @@ _arguments "${_arguments_options[@]}" \
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:test-quote-help-command-$line[1]:"
curcontext="${curcontext%:*:*}:exhaustive-quote-help-command-$line[1]:"
case $line[1] in
(cmd-single-quotes)
_arguments "${_arguments_options[@]}" \
@ -188,7 +188,7 @@ _arguments "${_arguments_options[@]}" \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_test__pacman_commands" \
":: :_exhaustive__pacman_commands" \
"*::: :->pacman" \
&& ret=0
@ -196,7 +196,7 @@ _arguments "${_arguments_options[@]}" \
(pacman)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:test-pacman-command-$line[1]:"
curcontext="${curcontext%:*:*}:exhaustive-pacman-command-$line[1]:"
case $line[1] in
(one)
_arguments "${_arguments_options[@]}" \
@ -218,7 +218,7 @@ _arguments "${_arguments_options[@]}" \
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_test__pacman__help_commands" \
":: :_exhaustive__pacman__help_commands" \
"*::: :->help" \
&& ret=0
@ -226,7 +226,7 @@ _arguments "${_arguments_options[@]}" \
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:test-pacman-help-command-$line[1]:"
curcontext="${curcontext%:*:*}:exhaustive-pacman-help-command-$line[1]:"
case $line[1] in
(one)
_arguments "${_arguments_options[@]}" \
@ -307,9 +307,21 @@ _arguments "${_arguments_options[@]}" \
'*::command_with_args:_cmdambivalent' \
&& ret=0
;;
(complete)
_arguments "${_arguments_options[@]}" \
'--shell=[Specify shell to complete for]:SHELL:(bash)' \
'--register=[Path to write completion-registration to]:REGISTER:_files' \
'--global[everywhere]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'*::comp_words:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
":: :_test__help_commands" \
":: :_exhaustive__help_commands" \
"*::: :->help" \
&& ret=0
@ -317,7 +329,7 @@ _arguments "${_arguments_options[@]}" \
(help)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:test-help-command-$line[1]:"
curcontext="${curcontext%:*:*}:exhaustive-help-command-$line[1]:"
case $line[1] in
(action)
_arguments "${_arguments_options[@]}" \
@ -325,7 +337,7 @@ _arguments "${_arguments_options[@]}" \
;;
(quote)
_arguments "${_arguments_options[@]}" \
":: :_test__help__quote_commands" \
":: :_exhaustive__help__quote_commands" \
"*::: :->quote" \
&& ret=0
@ -333,7 +345,7 @@ _arguments "${_arguments_options[@]}" \
(quote)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:test-help-quote-command-$line[1]:"
curcontext="${curcontext%:*:*}:exhaustive-help-quote-command-$line[1]:"
case $line[1] in
(cmd-single-quotes)
_arguments "${_arguments_options[@]}" \
@ -369,7 +381,7 @@ _arguments "${_arguments_options[@]}" \
;;
(pacman)
_arguments "${_arguments_options[@]}" \
":: :_test__help__pacman_commands" \
":: :_exhaustive__help__pacman_commands" \
"*::: :->pacman" \
&& ret=0
@ -377,7 +389,7 @@ _arguments "${_arguments_options[@]}" \
(pacman)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:test-help-pacman-command-$line[1]:"
curcontext="${curcontext%:*:*}:exhaustive-help-pacman-command-$line[1]:"
case $line[1] in
(one)
_arguments "${_arguments_options[@]}" \
@ -403,6 +415,10 @@ _arguments "${_arguments_options[@]}" \
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(complete)
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
&& ret=0
@ -416,8 +432,8 @@ esac
esac
}
(( $+functions[_test_commands] )) ||
_test_commands() {
(( $+functions[_exhaustive_commands] )) ||
_exhaustive_commands() {
local commands; commands=(
'action:' \
'quote:' \
@ -426,122 +442,133 @@ _test_commands() {
'last:' \
'alias:' \
'hint:' \
'complete:Register shell completions for this program' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'test commands' commands "$@"
_describe -t commands 'exhaustive commands' commands "$@"
}
(( $+functions[_test__action_commands] )) ||
_test__action_commands() {
(( $+functions[_exhaustive__action_commands] )) ||
_exhaustive__action_commands() {
local commands; commands=()
_describe -t commands 'test action commands' commands "$@"
_describe -t commands 'exhaustive action commands' commands "$@"
}
(( $+functions[_test__help__action_commands] )) ||
_test__help__action_commands() {
(( $+functions[_exhaustive__help__action_commands] )) ||
_exhaustive__help__action_commands() {
local commands; commands=()
_describe -t commands 'test help action commands' commands "$@"
_describe -t commands 'exhaustive help action commands' commands "$@"
}
(( $+functions[_test__alias_commands] )) ||
_test__alias_commands() {
(( $+functions[_exhaustive__alias_commands] )) ||
_exhaustive__alias_commands() {
local commands; commands=()
_describe -t commands 'test alias commands' commands "$@"
_describe -t commands 'exhaustive alias commands' commands "$@"
}
(( $+functions[_test__help__alias_commands] )) ||
_test__help__alias_commands() {
(( $+functions[_exhaustive__help__alias_commands] )) ||
_exhaustive__help__alias_commands() {
local commands; commands=()
_describe -t commands 'test help alias commands' commands "$@"
_describe -t commands 'exhaustive help alias commands' commands "$@"
}
(( $+functions[_test__help__quote__cmd-backslash_commands] )) ||
_test__help__quote__cmd-backslash_commands() {
(( $+functions[_exhaustive__help__quote__cmd-backslash_commands] )) ||
_exhaustive__help__quote__cmd-backslash_commands() {
local commands; commands=()
_describe -t commands 'test help quote cmd-backslash commands' commands "$@"
_describe -t commands 'exhaustive help quote cmd-backslash commands' commands "$@"
}
(( $+functions[_test__quote__cmd-backslash_commands] )) ||
_test__quote__cmd-backslash_commands() {
(( $+functions[_exhaustive__quote__cmd-backslash_commands] )) ||
_exhaustive__quote__cmd-backslash_commands() {
local commands; commands=()
_describe -t commands 'test quote cmd-backslash commands' commands "$@"
_describe -t commands 'exhaustive quote cmd-backslash commands' commands "$@"
}
(( $+functions[_test__quote__help__cmd-backslash_commands] )) ||
_test__quote__help__cmd-backslash_commands() {
(( $+functions[_exhaustive__quote__help__cmd-backslash_commands] )) ||
_exhaustive__quote__help__cmd-backslash_commands() {
local commands; commands=()
_describe -t commands 'test quote help cmd-backslash commands' commands "$@"
_describe -t commands 'exhaustive quote help cmd-backslash commands' commands "$@"
}
(( $+functions[_test__help__quote__cmd-backticks_commands] )) ||
_test__help__quote__cmd-backticks_commands() {
(( $+functions[_exhaustive__help__quote__cmd-backticks_commands] )) ||
_exhaustive__help__quote__cmd-backticks_commands() {
local commands; commands=()
_describe -t commands 'test help quote cmd-backticks commands' commands "$@"
_describe -t commands 'exhaustive help quote cmd-backticks commands' commands "$@"
}
(( $+functions[_test__quote__cmd-backticks_commands] )) ||
_test__quote__cmd-backticks_commands() {
(( $+functions[_exhaustive__quote__cmd-backticks_commands] )) ||
_exhaustive__quote__cmd-backticks_commands() {
local commands; commands=()
_describe -t commands 'test quote cmd-backticks commands' commands "$@"
_describe -t commands 'exhaustive quote cmd-backticks commands' commands "$@"
}
(( $+functions[_test__quote__help__cmd-backticks_commands] )) ||
_test__quote__help__cmd-backticks_commands() {
(( $+functions[_exhaustive__quote__help__cmd-backticks_commands] )) ||
_exhaustive__quote__help__cmd-backticks_commands() {
local commands; commands=()
_describe -t commands 'test quote help cmd-backticks commands' commands "$@"
_describe -t commands 'exhaustive quote help cmd-backticks commands' commands "$@"
}
(( $+functions[_test__help__quote__cmd-brackets_commands] )) ||
_test__help__quote__cmd-brackets_commands() {
(( $+functions[_exhaustive__help__quote__cmd-brackets_commands] )) ||
_exhaustive__help__quote__cmd-brackets_commands() {
local commands; commands=()
_describe -t commands 'test help quote cmd-brackets commands' commands "$@"
_describe -t commands 'exhaustive help quote cmd-brackets commands' commands "$@"
}
(( $+functions[_test__quote__cmd-brackets_commands] )) ||
_test__quote__cmd-brackets_commands() {
(( $+functions[_exhaustive__quote__cmd-brackets_commands] )) ||
_exhaustive__quote__cmd-brackets_commands() {
local commands; commands=()
_describe -t commands 'test quote cmd-brackets commands' commands "$@"
_describe -t commands 'exhaustive quote cmd-brackets commands' commands "$@"
}
(( $+functions[_test__quote__help__cmd-brackets_commands] )) ||
_test__quote__help__cmd-brackets_commands() {
(( $+functions[_exhaustive__quote__help__cmd-brackets_commands] )) ||
_exhaustive__quote__help__cmd-brackets_commands() {
local commands; commands=()
_describe -t commands 'test quote help cmd-brackets commands' commands "$@"
_describe -t commands 'exhaustive quote help cmd-brackets commands' commands "$@"
}
(( $+functions[_test__help__quote__cmd-double-quotes_commands] )) ||
_test__help__quote__cmd-double-quotes_commands() {
(( $+functions[_exhaustive__help__quote__cmd-double-quotes_commands] )) ||
_exhaustive__help__quote__cmd-double-quotes_commands() {
local commands; commands=()
_describe -t commands 'test help quote cmd-double-quotes commands' commands "$@"
_describe -t commands 'exhaustive help quote cmd-double-quotes commands' commands "$@"
}
(( $+functions[_test__quote__cmd-double-quotes_commands] )) ||
_test__quote__cmd-double-quotes_commands() {
(( $+functions[_exhaustive__quote__cmd-double-quotes_commands] )) ||
_exhaustive__quote__cmd-double-quotes_commands() {
local commands; commands=()
_describe -t commands 'test quote cmd-double-quotes commands' commands "$@"
_describe -t commands 'exhaustive quote cmd-double-quotes commands' commands "$@"
}
(( $+functions[_test__quote__help__cmd-double-quotes_commands] )) ||
_test__quote__help__cmd-double-quotes_commands() {
(( $+functions[_exhaustive__quote__help__cmd-double-quotes_commands] )) ||
_exhaustive__quote__help__cmd-double-quotes_commands() {
local commands; commands=()
_describe -t commands 'test quote help cmd-double-quotes commands' commands "$@"
_describe -t commands 'exhaustive quote help cmd-double-quotes commands' commands "$@"
}
(( $+functions[_test__help__quote__cmd-expansions_commands] )) ||
_test__help__quote__cmd-expansions_commands() {
(( $+functions[_exhaustive__help__quote__cmd-expansions_commands] )) ||
_exhaustive__help__quote__cmd-expansions_commands() {
local commands; commands=()
_describe -t commands 'test help quote cmd-expansions commands' commands "$@"
_describe -t commands 'exhaustive help quote cmd-expansions commands' commands "$@"
}
(( $+functions[_test__quote__cmd-expansions_commands] )) ||
_test__quote__cmd-expansions_commands() {
(( $+functions[_exhaustive__quote__cmd-expansions_commands] )) ||
_exhaustive__quote__cmd-expansions_commands() {
local commands; commands=()
_describe -t commands 'test quote cmd-expansions commands' commands "$@"
_describe -t commands 'exhaustive quote cmd-expansions commands' commands "$@"
}
(( $+functions[_test__quote__help__cmd-expansions_commands] )) ||
_test__quote__help__cmd-expansions_commands() {
(( $+functions[_exhaustive__quote__help__cmd-expansions_commands] )) ||
_exhaustive__quote__help__cmd-expansions_commands() {
local commands; commands=()
_describe -t commands 'test quote help cmd-expansions commands' commands "$@"
_describe -t commands 'exhaustive quote help cmd-expansions commands' commands "$@"
}
(( $+functions[_test__help__quote__cmd-single-quotes_commands] )) ||
_test__help__quote__cmd-single-quotes_commands() {
(( $+functions[_exhaustive__help__quote__cmd-single-quotes_commands] )) ||
_exhaustive__help__quote__cmd-single-quotes_commands() {
local commands; commands=()
_describe -t commands 'test help quote cmd-single-quotes commands' commands "$@"
_describe -t commands 'exhaustive help quote cmd-single-quotes commands' commands "$@"
}
(( $+functions[_test__quote__cmd-single-quotes_commands] )) ||
_test__quote__cmd-single-quotes_commands() {
(( $+functions[_exhaustive__quote__cmd-single-quotes_commands] )) ||
_exhaustive__quote__cmd-single-quotes_commands() {
local commands; commands=()
_describe -t commands 'test quote cmd-single-quotes commands' commands "$@"
_describe -t commands 'exhaustive quote cmd-single-quotes commands' commands "$@"
}
(( $+functions[_test__quote__help__cmd-single-quotes_commands] )) ||
_test__quote__help__cmd-single-quotes_commands() {
(( $+functions[_exhaustive__quote__help__cmd-single-quotes_commands] )) ||
_exhaustive__quote__help__cmd-single-quotes_commands() {
local commands; commands=()
_describe -t commands 'test quote help cmd-single-quotes commands' commands "$@"
_describe -t commands 'exhaustive quote help cmd-single-quotes commands' commands "$@"
}
(( $+functions[_test__help_commands] )) ||
_test__help_commands() {
(( $+functions[_exhaustive__complete_commands] )) ||
_exhaustive__complete_commands() {
local commands; commands=()
_describe -t commands 'exhaustive complete commands' commands "$@"
}
(( $+functions[_exhaustive__help__complete_commands] )) ||
_exhaustive__help__complete_commands() {
local commands; commands=()
_describe -t commands 'exhaustive help complete commands' commands "$@"
}
(( $+functions[_exhaustive__help_commands] )) ||
_exhaustive__help_commands() {
local commands; commands=(
'action:' \
'quote:' \
@ -550,31 +577,32 @@ _test__help_commands() {
'last:' \
'alias:' \
'hint:' \
'complete:Register shell completions for this program' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'test help commands' commands "$@"
_describe -t commands 'exhaustive help commands' commands "$@"
}
(( $+functions[_test__help__help_commands] )) ||
_test__help__help_commands() {
(( $+functions[_exhaustive__help__help_commands] )) ||
_exhaustive__help__help_commands() {
local commands; commands=()
_describe -t commands 'test help help commands' commands "$@"
_describe -t commands 'exhaustive help help commands' commands "$@"
}
(( $+functions[_test__pacman__help_commands] )) ||
_test__pacman__help_commands() {
(( $+functions[_exhaustive__pacman__help_commands] )) ||
_exhaustive__pacman__help_commands() {
local commands; commands=(
'one:' \
'two:' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'test pacman help commands' commands "$@"
_describe -t commands 'exhaustive pacman help commands' commands "$@"
}
(( $+functions[_test__pacman__help__help_commands] )) ||
_test__pacman__help__help_commands() {
(( $+functions[_exhaustive__pacman__help__help_commands] )) ||
_exhaustive__pacman__help__help_commands() {
local commands; commands=()
_describe -t commands 'test pacman help help commands' commands "$@"
_describe -t commands 'exhaustive pacman help help commands' commands "$@"
}
(( $+functions[_test__quote__help_commands] )) ||
_test__quote__help_commands() {
(( $+functions[_exhaustive__quote__help_commands] )) ||
_exhaustive__quote__help_commands() {
local commands; commands=(
'cmd-single-quotes:Can be '\''always'\'', '\''auto'\'', or '\''never'\''' \
'cmd-double-quotes:Can be "always", "auto", or "never"' \
@ -584,67 +612,67 @@ _test__quote__help_commands() {
'cmd-expansions:Execute the shell command with \$SHELL' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'test quote help commands' commands "$@"
_describe -t commands 'exhaustive quote help commands' commands "$@"
}
(( $+functions[_test__quote__help__help_commands] )) ||
_test__quote__help__help_commands() {
(( $+functions[_exhaustive__quote__help__help_commands] )) ||
_exhaustive__quote__help__help_commands() {
local commands; commands=()
_describe -t commands 'test quote help help commands' commands "$@"
_describe -t commands 'exhaustive quote help help commands' commands "$@"
}
(( $+functions[_test__help__hint_commands] )) ||
_test__help__hint_commands() {
(( $+functions[_exhaustive__help__hint_commands] )) ||
_exhaustive__help__hint_commands() {
local commands; commands=()
_describe -t commands 'test help hint commands' commands "$@"
_describe -t commands 'exhaustive help hint commands' commands "$@"
}
(( $+functions[_test__hint_commands] )) ||
_test__hint_commands() {
(( $+functions[_exhaustive__hint_commands] )) ||
_exhaustive__hint_commands() {
local commands; commands=()
_describe -t commands 'test hint commands' commands "$@"
_describe -t commands 'exhaustive hint commands' commands "$@"
}
(( $+functions[_test__help__last_commands] )) ||
_test__help__last_commands() {
(( $+functions[_exhaustive__help__last_commands] )) ||
_exhaustive__help__last_commands() {
local commands; commands=()
_describe -t commands 'test help last commands' commands "$@"
_describe -t commands 'exhaustive help last commands' commands "$@"
}
(( $+functions[_test__last_commands] )) ||
_test__last_commands() {
(( $+functions[_exhaustive__last_commands] )) ||
_exhaustive__last_commands() {
local commands; commands=()
_describe -t commands 'test last commands' commands "$@"
_describe -t commands 'exhaustive last commands' commands "$@"
}
(( $+functions[_test__help__pacman__one_commands] )) ||
_test__help__pacman__one_commands() {
(( $+functions[_exhaustive__help__pacman__one_commands] )) ||
_exhaustive__help__pacman__one_commands() {
local commands; commands=()
_describe -t commands 'test help pacman one commands' commands "$@"
_describe -t commands 'exhaustive help pacman one commands' commands "$@"
}
(( $+functions[_test__pacman__help__one_commands] )) ||
_test__pacman__help__one_commands() {
(( $+functions[_exhaustive__pacman__help__one_commands] )) ||
_exhaustive__pacman__help__one_commands() {
local commands; commands=()
_describe -t commands 'test pacman help one commands' commands "$@"
_describe -t commands 'exhaustive pacman help one commands' commands "$@"
}
(( $+functions[_test__pacman__one_commands] )) ||
_test__pacman__one_commands() {
(( $+functions[_exhaustive__pacman__one_commands] )) ||
_exhaustive__pacman__one_commands() {
local commands; commands=()
_describe -t commands 'test pacman one commands' commands "$@"
_describe -t commands 'exhaustive pacman one commands' commands "$@"
}
(( $+functions[_test__help__pacman_commands] )) ||
_test__help__pacman_commands() {
(( $+functions[_exhaustive__help__pacman_commands] )) ||
_exhaustive__help__pacman_commands() {
local commands; commands=(
'one:' \
'two:' \
)
_describe -t commands 'test help pacman commands' commands "$@"
_describe -t commands 'exhaustive help pacman commands' commands "$@"
}
(( $+functions[_test__pacman_commands] )) ||
_test__pacman_commands() {
(( $+functions[_exhaustive__pacman_commands] )) ||
_exhaustive__pacman_commands() {
local commands; commands=(
'one:' \
'two:' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'test pacman commands' commands "$@"
_describe -t commands 'exhaustive pacman commands' commands "$@"
}
(( $+functions[_test__help__quote_commands] )) ||
_test__help__quote_commands() {
(( $+functions[_exhaustive__help__quote_commands] )) ||
_exhaustive__help__quote_commands() {
local commands; commands=(
'cmd-single-quotes:Can be '\''always'\'', '\''auto'\'', or '\''never'\''' \
'cmd-double-quotes:Can be "always", "auto", or "never"' \
@ -653,10 +681,10 @@ _test__help__quote_commands() {
'cmd-brackets:List packages \[filter\]' \
'cmd-expansions:Execute the shell command with \$SHELL' \
)
_describe -t commands 'test help quote commands' commands "$@"
_describe -t commands 'exhaustive help quote commands' commands "$@"
}
(( $+functions[_test__quote_commands] )) ||
_test__quote_commands() {
(( $+functions[_exhaustive__quote_commands] )) ||
_exhaustive__quote_commands() {
local commands; commands=(
'cmd-single-quotes:Can be '\''always'\'', '\''auto'\'', or '\''never'\''' \
'cmd-double-quotes:Can be "always", "auto", or "never"' \
@ -666,36 +694,36 @@ _test__quote_commands() {
'cmd-expansions:Execute the shell command with \$SHELL' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'test quote commands' commands "$@"
_describe -t commands 'exhaustive quote commands' commands "$@"
}
(( $+functions[_test__help__pacman__two_commands] )) ||
_test__help__pacman__two_commands() {
(( $+functions[_exhaustive__help__pacman__two_commands] )) ||
_exhaustive__help__pacman__two_commands() {
local commands; commands=()
_describe -t commands 'test help pacman two commands' commands "$@"
_describe -t commands 'exhaustive help pacman two commands' commands "$@"
}
(( $+functions[_test__pacman__help__two_commands] )) ||
_test__pacman__help__two_commands() {
(( $+functions[_exhaustive__pacman__help__two_commands] )) ||
_exhaustive__pacman__help__two_commands() {
local commands; commands=()
_describe -t commands 'test pacman help two commands' commands "$@"
_describe -t commands 'exhaustive pacman help two commands' commands "$@"
}
(( $+functions[_test__pacman__two_commands] )) ||
_test__pacman__two_commands() {
(( $+functions[_exhaustive__pacman__two_commands] )) ||
_exhaustive__pacman__two_commands() {
local commands; commands=()
_describe -t commands 'test pacman two commands' commands "$@"
_describe -t commands 'exhaustive pacman two commands' commands "$@"
}
(( $+functions[_test__help__value_commands] )) ||
_test__help__value_commands() {
(( $+functions[_exhaustive__help__value_commands] )) ||
_exhaustive__help__value_commands() {
local commands; commands=()
_describe -t commands 'test help value commands' commands "$@"
_describe -t commands 'exhaustive help value commands' commands "$@"
}
(( $+functions[_test__value_commands] )) ||
_test__value_commands() {
(( $+functions[_exhaustive__value_commands] )) ||
_exhaustive__value_commands() {
local commands; commands=()
_describe -t commands 'test value commands' commands "$@"
_describe -t commands 'exhaustive value commands' commands "$@"
}
if [ "$funcstack[1]" = "_test" ]; then
_test "$@"
if [ "$funcstack[1]" = "_exhaustive" ]; then
_exhaustive "$@"
else
compdef _test test
compdef _exhaustive exhaustive
fi

View file

@ -1,121 +0,0 @@
complete -c test -n "__fish_use_subcommand" -l generate -d 'generate' -r -f -a "{bash ,elvish ,fish ,powershell ,zsh }"
complete -c test -n "__fish_use_subcommand" -l global -d 'everywhere'
complete -c test -n "__fish_use_subcommand" -s h -l help -d 'Print help'
complete -c test -n "__fish_use_subcommand" -s V -l version -d 'Print version'
complete -c test -n "__fish_use_subcommand" -f -a "action"
complete -c test -n "__fish_use_subcommand" -f -a "quote"
complete -c test -n "__fish_use_subcommand" -f -a "value"
complete -c test -n "__fish_use_subcommand" -f -a "pacman"
complete -c test -n "__fish_use_subcommand" -f -a "last"
complete -c test -n "__fish_use_subcommand" -f -a "alias"
complete -c test -n "__fish_use_subcommand" -f -a "hint"
complete -c test -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c test -n "__fish_seen_subcommand_from action" -l set -d 'value' -r
complete -c test -n "__fish_seen_subcommand_from action" -l choice -d 'enum' -r -f -a "{first ,second }"
complete -c test -n "__fish_seen_subcommand_from action" -l set-true -d 'bool'
complete -c test -n "__fish_seen_subcommand_from action" -l count -d 'number'
complete -c test -n "__fish_seen_subcommand_from action" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from action" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from action" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l single-quotes -d 'Can be \'always\', \'auto\', or \'never\''
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l double-quotes -d 'Can be "always", "auto", or "never"'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l backticks -d 'For more information see `echo test`'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l backslash -d 'Avoid \'\\n\''
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l brackets -d 'List packages [filter]'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l expansions -d 'Execute the shell command with $SHELL'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-single-quotes" -d 'Can be \'always\', \'auto\', or \'never\''
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-double-quotes" -d 'Can be "always", "auto", or "never"'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backticks" -d 'For more information see `echo test`'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backslash" -d 'Avoid \'\\n\''
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-brackets" -d 'List packages [filter]'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-expansions" -d 'Execute the shell command with $SHELL'
complete -c test -n "__fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-single-quotes" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-single-quotes" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-single-quotes" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-double-quotes" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-double-quotes" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-double-quotes" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backticks" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backticks" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backticks" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backslash" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backslash" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-backslash" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-brackets" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-brackets" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-brackets" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-expansions" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-expansions" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from cmd-expansions" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-single-quotes" -d 'Can be \'always\', \'auto\', or \'never\''
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-double-quotes" -d 'Can be "always", "auto", or "never"'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backticks" -d 'For more information see `echo test`'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backslash" -d 'Avoid \'\\n\''
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-brackets" -d 'List packages [filter]'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-expansions" -d 'Execute the shell command with $SHELL'
complete -c test -n "__fish_seen_subcommand_from quote; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c test -n "__fish_seen_subcommand_from value" -l delim -r
complete -c test -n "__fish_seen_subcommand_from value" -l tuple -r
complete -c test -n "__fish_seen_subcommand_from value" -l require-eq -r
complete -c test -n "__fish_seen_subcommand_from value" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from value" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from value" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "one"
complete -c test -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "two"
complete -c test -n "__fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from one" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from one" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from one" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from two" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from two" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from two" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "one"
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "two"
complete -c test -n "__fish_seen_subcommand_from pacman; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c test -n "__fish_seen_subcommand_from last" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from last" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from last" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from alias" -s o -s O -l option -l opt -d 'cmd option' -r
complete -c test -n "__fish_seen_subcommand_from alias" -s f -s F -l flag -l flg -d 'cmd flag'
complete -c test -n "__fish_seen_subcommand_from alias" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from alias" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from alias" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from hint" -l choice -r -f -a "{bash ,fish ,zsh }"
complete -c test -n "__fish_seen_subcommand_from hint" -l unknown -r
complete -c test -n "__fish_seen_subcommand_from hint" -l other -r -f
complete -c test -n "__fish_seen_subcommand_from hint" -s p -l path -r -F
complete -c test -n "__fish_seen_subcommand_from hint" -s f -l file -r -F
complete -c test -n "__fish_seen_subcommand_from hint" -s d -l dir -r -f -a "(__fish_complete_directories)"
complete -c test -n "__fish_seen_subcommand_from hint" -s e -l exe -r -F
complete -c test -n "__fish_seen_subcommand_from hint" -l cmd-name -r -f -a "(__fish_complete_command)"
complete -c test -n "__fish_seen_subcommand_from hint" -s c -l cmd -r -f -a "(__fish_complete_command)"
complete -c test -n "__fish_seen_subcommand_from hint" -s u -l user -r -f -a "(__fish_complete_users)"
complete -c test -n "__fish_seen_subcommand_from hint" -s H -l host -r -f -a "(__fish_print_hostnames)"
complete -c test -n "__fish_seen_subcommand_from hint" -l url -r -f
complete -c test -n "__fish_seen_subcommand_from hint" -l email -r -f
complete -c test -n "__fish_seen_subcommand_from hint" -l global -d 'everywhere'
complete -c test -n "__fish_seen_subcommand_from hint" -s h -l help -d 'Print help'
complete -c test -n "__fish_seen_subcommand_from hint" -s V -l version -d 'Print version'
complete -c test -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from help" -f -a "action"
complete -c test -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from help" -f -a "quote"
complete -c test -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from help" -f -a "value"
complete -c test -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from help" -f -a "pacman"
complete -c test -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from help" -f -a "last"
complete -c test -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from help" -f -a "alias"
complete -c test -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from help" -f -a "hint"
complete -c test -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from action; and not __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from value; and not __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from last; and not __fish_seen_subcommand_from alias; and not __fish_seen_subcommand_from hint; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c test -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-single-quotes" -d 'Can be \'always\', \'auto\', or \'never\''
complete -c test -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-double-quotes" -d 'Can be "always", "auto", or "never"'
complete -c test -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-backticks" -d 'For more information see `echo test`'
complete -c test -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-backslash" -d 'Avoid \'\\n\''
complete -c test -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-brackets" -d 'List packages [filter]'
complete -c test -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from quote; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions" -f -a "cmd-expansions" -d 'Execute the shell command with $SHELL'
complete -c test -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two" -f -a "one"
complete -c test -n "__fish_seen_subcommand_from help; and __fish_seen_subcommand_from pacman; and not __fish_seen_subcommand_from one; and not __fish_seen_subcommand_from two" -f -a "two"

View file

@ -1,5 +1,6 @@
_clap_complete_my_app() {
export IFS=$'/013'
export _CLAP_COMPLETE_INDEX=${COMP_CWORD}
export _CLAP_COMPLETE_COMP_TYPE=${COMP_TYPE}
if compopt +o nospace 2> /dev/null; then
@ -7,7 +8,6 @@ _clap_complete_my_app() {
else
export _CLAP_COMPLETE_SPACE=true
fi
export _CLAP_COMPLETE_IFS=$'/013'
COMPREPLY=( $("my-app" complete --shell bash -- "${COMP_WORDS[@]}") )
if [[ $? != 0 ]]; then
unset COMPREPLY

View file

@ -141,11 +141,7 @@ fn subcommand_last() {
#[test]
#[cfg(unix)]
fn register_completion() {
if !common::has_command("bash") {
return;
}
common::register_example("test", completest::Shell::Bash);
common::register_example("static", "exhaustive", completest::Shell::Bash);
}
#[test]
@ -156,12 +152,18 @@ fn complete() {
}
let term = completest::Term::new();
let mut runtime = common::load_runtime("test", completest::Shell::Bash);
let mut runtime = common::load_runtime("static", "exhaustive", completest::Shell::Bash);
let input = "test \t\t";
let input = "exhaustive \t\t";
let expected = r#"%
-h --global --help action value last hint
-V --generate --version quote pacman alias help"#;
-h --global --help action value last hint help
-V --generate --version quote pacman alias complete"#;
let actual = runtime.complete(input, &term).unwrap();
snapbox::assert_eq(expected, actual);
}
#[test]
#[cfg(unix)]
fn register_dynamic_completion() {
common::register_example("dynamic", "exhaustive", completest::Shell::Bash);
}

View file

@ -296,27 +296,43 @@ pub fn assert_matches_path(
.matches_path(expected_path, buf);
}
pub fn register_example(name: &str, shell: completest::Shell) {
pub fn register_example(context: &str, name: &str, shell: completest::Shell) {
let scratch = snapbox::path::PathFixture::mutable_temp().unwrap();
let scratch_path = scratch.path().unwrap();
let shell_name = shell.name();
let home = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.join("tests/snapshots/home")
.join(context)
.join(name)
.join(shell_name);
println!("Compiling");
let manifest_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml");
let bin_path =
snapbox::cmd::compile_example(name, ["--manifest-path", manifest_path.to_str().unwrap()])
.unwrap();
let bin_path = snapbox::cmd::compile_example(
name,
[
"--manifest-path",
manifest_path.to_str().unwrap(),
// Unconditionally include to avoid completion file tests failing based on the how
// `cargo test` is invoked
"--features=unstable-dynamic",
],
)
.unwrap();
println!("Compiled");
let bin_root = bin_path.parent().unwrap().to_owned();
let registration = std::process::Command::new(&bin_path)
.arg(format!("--generate={shell_name}"))
.output()
.unwrap();
let mut registration = std::process::Command::new(&bin_path);
match context {
"static" => registration.args([format!("--generate={shell_name}")]),
"dynamic" => registration.args([
"complete".to_owned(),
"--register=-".to_owned(),
format!("--shell={shell_name}"),
]),
_ => unreachable!("unsupported context {}", context),
};
let registration = registration.output().unwrap();
assert!(
registration.status.success(),
"{}",
@ -334,10 +350,15 @@ pub fn register_example(name: &str, shell: completest::Shell) {
scratch.close().unwrap();
}
pub fn load_runtime(name: &str, shell: completest::Shell) -> Box<dyn completest::Runtime> {
pub fn load_runtime(
context: &str,
name: &str,
shell: completest::Shell,
) -> Box<dyn completest::Runtime> {
let shell_name = shell.name();
let home = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.join("tests/snapshots/home")
.join(context)
.join(name)
.join(shell_name);
let scratch = snapbox::path::PathFixture::mutable_temp()
@ -347,9 +368,17 @@ pub fn load_runtime(name: &str, shell: completest::Shell) -> Box<dyn completest:
let home = scratch.path().unwrap().to_owned();
println!("Compiling");
let manifest_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("Cargo.toml");
let bin_path =
snapbox::cmd::compile_example(name, ["--manifest-path", manifest_path.to_str().unwrap()])
.unwrap();
let bin_path = snapbox::cmd::compile_example(
name,
[
"--manifest-path",
manifest_path.to_str().unwrap(),
// Unconditionally include to avoid completion file tests failing based on the how
// `cargo test` is invoked
"--features=unstable-dynamic",
],
)
.unwrap();
println!("Compiled");
let bin_root = bin_path.parent().unwrap().to_owned();

View file

@ -2,7 +2,7 @@
#[test]
fn suggest_subcommand_subset() {
let name = "test";
let name = "exhaustive";
let mut cmd = clap::Command::new(name)
.subcommand(clap::Command::new("hello-world"))
.subcommand(clap::Command::new("hello-moon"))
@ -27,7 +27,7 @@ fn suggest_subcommand_subset() {
#[test]
fn suggest_long_flag_subset() {
let name = "test";
let name = "exhaustive";
let mut cmd = clap::Command::new(name)
.arg(
clap::Arg::new("hello-world")
@ -64,7 +64,7 @@ fn suggest_long_flag_subset() {
#[test]
fn suggest_possible_value_subset() {
let name = "test";
let name = "exhaustive";
let mut cmd = clap::Command::new(name).arg(clap::Arg::new("hello-world").value_parser([
"hello-world",
"hello-moon",
@ -90,7 +90,7 @@ fn suggest_possible_value_subset() {
#[test]
fn suggest_additional_short_flags() {
let name = "test";
let name = "exhaustive";
let mut cmd = clap::Command::new(name)
.arg(
clap::Arg::new("a")

View file

@ -123,11 +123,7 @@ fn subcommand_last() {
#[test]
#[cfg(unix)]
fn register_completion() {
if !common::has_command("elvish") {
return;
}
common::register_example("test", completest::Shell::Elvish);
common::register_example("static", "exhaustive", completest::Shell::Elvish);
}
#[test]
@ -138,10 +134,10 @@ fn complete() {
}
let term = completest::Term::new();
let mut runtime = common::load_runtime("test", completest::Shell::Elvish);
let mut runtime = common::load_runtime("static", "exhaustive", completest::Shell::Elvish);
let input = "test \t";
let expected = r#"% test --generate
let input = "exhaustive \t";
let expected = r#"% exhaustive --generate
--generate generate
--global everywhere
--help Print help
@ -150,6 +146,7 @@ fn complete() {
-h Print help
action action
alias alias
complete Register shell completions for this program
help Print this message or the help of the given subcommand(s)
hint hint
last last

View file

@ -123,11 +123,7 @@ fn subcommand_last() {
#[test]
#[cfg(unix)]
fn register_completion() {
if !common::has_command("fish") {
return;
}
common::register_example("test", completest::Shell::Fish);
common::register_example("static", "exhaustive", completest::Shell::Fish);
}
#[test]
@ -138,12 +134,12 @@ fn complete() {
}
let term = completest::Term::new();
let mut runtime = common::load_runtime("test", completest::Shell::Fish);
let mut runtime = common::load_runtime("static", "exhaustive", completest::Shell::Fish);
let input = "test \t";
let expected = r#"% test
action help (Print this message or the help of the given subcommand(s)) last quote
alias hint pacman value"#;
let input = "exhaustive \t";
let expected = r#"% exhaustive
action complete (Register shell completions for this program) hint pacman value
alias help (Print this message or the help of the given subcommand(s)) last quote"#;
let actual = runtime.complete(input, &term).unwrap();
snapbox::assert_eq(expected, actual);
}

View file

@ -123,11 +123,7 @@ fn subcommand_last() {
#[test]
#[cfg(unix)]
fn register_completion() {
if !common::has_command("zsh") {
return;
}
common::register_example("test", completest::Shell::Zsh);
common::register_example("static", "exhaustive", completest::Shell::Zsh);
}
#[test]
@ -138,12 +134,13 @@ fn complete() {
}
let term = completest::Term::new();
let mut runtime = common::load_runtime("test", completest::Shell::Zsh);
let mut runtime = common::load_runtime("static", "exhaustive", completest::Shell::Zsh);
let input = "test \t";
let expected = r#"% test
help -- Print this message or the help of the given subcommand(s)
pacman action alias value quote hint last --"#;
let input = "exhaustive \t";
let expected = r#"% exhaustive
complete -- Register shell completions for this program
help -- Print this message or the help of the given subcommand(s)
pacman action alias value quote hint last --"#;
let actual = runtime.complete(input, &term).unwrap();
snapbox::assert_eq(expected, actual);
}