You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be some way to require all property wrapper attributes (@Argument, etc.) to have a completion: argument if Swift Argument Parser cannot autogenerate shell completion candidates.
Some command-line parameters are unable to have completion candidates offered (like an account name, an unconstrained number, etc.), so a new none case for CompletionKind.Kind & an associated CompletionKind.none static property should be added.
If a shell's completion system can nicely indicate the type, name, or other info about a non-completable argument or option value, or even flat-out reject invalid values (like characters that aren't digits for an integer argument), then the completion scripts generated for that shell should properly configure those features.
This detection should be optional at build time (given it's a new feature, I assume the default should be to not perform such detection).
If detection at compile time proves too onerous or impossible to implement, then this detection could be performed when a --strict (or otherwise named) flag is included in the command line used to generate a completion script (using the --generate-completion-script flag).
The text was updated successfully, but these errors were encountered:
It seems like we could support an environment variable that enables this more strict mode, so that as a tool author you could have that requirement validated. I believe we have an environment variable that disables the other command type validations that we do at runtime in debug mode by default, so there's precedent.
I probably won't get to this anytime soon, as there are more important SAP issues & issues for my project, but I wanted to document the idea for future reference.
I'll let you know if & when I think I'll try to tackle this, but it won't be before I finish a PR for #679.
There should be some way to require all property wrapper attributes (
@Argument
, etc.) to have acompletion:
argument if Swift Argument Parser cannot autogenerate shell completion candidates.Some command-line parameters are unable to have completion candidates offered (like an account name, an unconstrained number, etc.), so a new
none
case forCompletionKind.Kind
& an associatedCompletionKind.none
static property should be added.If a shell's completion system can nicely indicate the type, name, or other info about a non-completable argument or option value, or even flat-out reject invalid values (like characters that aren't digits for an integer argument), then the completion scripts generated for that shell should properly configure those features.
This detection should be optional at build time (given it's a new feature, I assume the default should be to not perform such detection).
If detection at compile time proves too onerous or impossible to implement, then this detection could be performed when a
--strict
(or otherwise named) flag is included in the command line used to generate a completion script (using the--generate-completion-script
flag).The text was updated successfully, but these errors were encountered: