rush_complete - emit completion candidates and inspect completion context.
rush_complete candidate value [--kind kind] [--description text] [--priority n] [--no-space] rush_complete files rush_complete directories [--append-slash] rush_complete aliases rush_complete variables rush_complete functions rush_complete jobs rush_complete option-present (--long name | --short name) rush_complete option-values (--long name | --short name) rush_complete operand index
rush_complete is the Rush completion provider API. It is intended for functions referenced by completion manifests, not for ordinary interactive commands. A provider function runs in a hidden captured completion context. Calls to rush_complete candidate, rush_complete files, rush_complete directories, and shell-state list commands append candidates to the current completion result.
Outside a completion provider invocation, rush_complete exits with a usage error because there is no provider context to receive candidates.
candidateplain, file, directory, subcommand, option, variable, function, command, and builtin. --priority accepts a signed 8-bit integer. Higher values prefer a candidate among otherwise comparable matches; Rush still performs final query-aware ordering. Omit it for priority 0, use small positive bands for contextual preference, and negative values are allowed specifically to derank fallback candidates.filesdirectoriesaliasesvariablesfunctionsjobsoption-presentoption-valuesoperandrush_completion_argument_indexrush_completion_options_terminatedtrue when -- has been parsed, otherwise false.rush_completion_value_positionvalue while completing an option value, otherwise item.__rush_complete_git_branches() {
git branch --format='%(refname:short)' 2>/dev/null |
while read ref; do
test -n "$ref" && rush_complete candidate "$ref" --kind plain --description branch
done
}
rush-builtins(7), Writing completions, Completion manifest schema.