-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Is your feature request related to a problem? Please describe.
When defining flags with aliases (e.g., noProgress with alias no-progress), the autocomplete completions only include the primary flag name (--noProgress) but not the aliases (--no-progress). This creates an inconsistent user experience where users can see and use flag aliases in --help output, but cannot tab-complete them.
static flags = {
noProgress: Flags.boolean({
aliases: ['no-progress'],
description: "Don't display any progress indicators",
}),
};Describe the solution you'd like
The autocomplete generators (zsh.js, bash-spaces.js, powershell.js) should iterate over flag.aliases and generate completion entries for each alias, similar to how command aliases are already handled.
In genZshFlagArgumentsBlock (zsh.js), after generating the spec for the main flag, also generate specs for each alias:
for (const flagName of flagNames) {
const f = flags[flagName];
// ... existing flag spec generation ...
// Add alias completions
if (f.aliases && Array.isArray(f.aliases)) {
for (const alias of f.aliases) {
// Generate completion spec for --${alias}
}
}
}Describe alternatives you've considered
- Extending the autocomplete command
- Attempted to create a custom autocomplete command that extends the plugin's Create command, but the package exports (
"exports": "./lib/index.js") don't expose the internal classes needed for extension.
- Attempted to create a custom autocomplete command that extends the plugin's Create command, but the package exports (
- Post-processing the generated files
- Could modify the generated completion files after they're created, but this is fragile and would break on plugin updates.
Additional context
- Command aliases are already supported in autocomplete (iterating over
c.aliases) - The flag aliases property is available in the flag definition and accessible via
f.aliases - This would provide consistency between
--helpoutput (which shows aliases) and autocomplete behavior
Metadata
Metadata
Assignees
Labels
No labels