-
-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab completion for CLI #267
Comments
Great idea! Just a heads up, the PS-script for tab completion for .NET CLI is taking the whole command, i.e. |
@phil-scott-78 @OskarKlintrot Another option would be to add a generator to Spectre.Console.Cli, that generates the shell binding s for an application, such as |
Stupid question but does it generate the equivalent of the ps-script you add to One thing to keep in mind is that it can be useful to be able to generate suggestions dynamically. For example, our CLI is for working with our repos so the suggestions of |
@OskarKlintrot Ah, no, it wouldn't. I see no problem with adding a dynamic generator as you suggested above 👍🏻 |
@patriksvensson @phil-scott-78 I think this would be so cool to have, that I am interested in starting a PR for this. I'd probably need some help though. From reading the code I have a reasonably clear idea where to start.I'm thinking of adding to the existing hidden default cli commands: Given an app (That's basically the unit test i've written) Need some more time to come up with actual implementation. |
Absolutely. Lets use this to brainstorm some scenarios and go from there. My little guy is stealing a ton of my time so extended coding sessions are a rarity so being able to assist would be great I'll try and come up with a few more test ideas to drive this tonight |
That sounds great! I have a little time today, so I'll see if I can come up with a little poc implementation to get my feet wet. I'll fork and push a branch to my github so you can have a look. |
|
@Jawz84 Great! Feel free to open a PR before finishing it so that we can have a continuous discussion. |
Superceded by #1243. |
I was going to toy around with adding powershell or bash tab completion for my app, but it occurred to me that it might be possible (and maybe even easier) to bake this in. I'd
The way some tools work is they provide something like a
completion
command that accepts the list of currently typed arguments (e.g. if I was typinggit checkout sp[tab]
it would rungit completion checkout sp
and the application would supply the tab information.My Saturday night plan for investigation the feasibility would be for simple things like enums and bools to automatically return the valid values. But for strings it would work like
ParameterValidationAttribute
where you could haveAnd you'd mark up your settings appropriately. You'd want services to be injected though. TBH I'm not sure if the validation code allows that as is.
Reading
The text was updated successfully, but these errors were encountered: