Support completion for command alias arguments (i.e. flags, options, option values, positional arguments, and/or subcommands).
I think that, at least by default, only the "real" command names (not aliases) should be offered to be completed, but, if an alias is used on the command line, its flags, options, option values, arguments, and subcommands should be offered as completions.
e.g. if you have a command c with a subcommand named real with an alias alias that has flags, options, arguments , and/or subcommands:
# offer real if you tab after r
c r
# do not offer alias if you tab after a
c a
# complete the flags, options, option values, arguments, and/or subcommands for real/alias
c real …
# complete the flags, options, option values, arguments, and/or subcommands for real/alias
c alias …
Maybe there could be a setting to also offer aliases when potentially completing to them (e.g., offering alias when tabbing after a), but I don't think that should be the default. The setting could be on a per overall command basis, per subcommands of a specific command, per specific subcommand, or per alias. If I submit a PR for this issue, however, I'd probably leave out any such setting.
ArgumentParser version: main
Swift version: n/a
Checklist
Steps to Reproduce
- Create a command with an alias & some flags
- Build
- Generate completion scripts
- Try to complete one of the flags after the alias
- See that no completions offered
Expected behavior
I expect completions for flags, options, option values, arguments, and subcommands to be offered after aliases.
Actual behavior
Completions aren't offered for the alias's args.
Support completion for command alias arguments (i.e. flags, options, option values, positional arguments, and/or subcommands).
I think that, at least by default, only the "real" command names (not aliases) should be offered to be completed, but, if an alias is used on the command line, its flags, options, option values, arguments, and subcommands should be offered as completions.
e.g. if you have a command
cwith a subcommand namedrealwith an aliasaliasthat has flags, options, arguments , and/or subcommands:Maybe there could be a setting to also offer aliases when potentially completing to them (e.g., offering
aliaswhen tabbing aftera), but I don't think that should be the default. The setting could be on a per overall command basis, per subcommands of a specific command, per specific subcommand, or per alias. If I submit a PR for this issue, however, I'd probably leave out any such setting.ArgumentParser version:
mainSwift version: n/a
Checklist
mainbranch of this packageSteps to Reproduce
Expected behavior
I expect completions for flags, options, option values, arguments, and subcommands to be offered after aliases.
Actual behavior
Completions aren't offered for the alias's args.