Skip to content

Tab completion for CLI #267

@phil-scott-78

Description

@phil-scott-78

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 typing git checkout sp[tab] it would run git 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 have

public abstract CompletionResult Complete(ICommandParameterInfo info, object? value);

And 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done 🚀

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions