question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tab completion for CLI

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:8
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
patriksvenssoncommented, Feb 6, 2022

@Jawz84 Great! Feel free to open a PR before finishing it so that we can have a continuous discussion.

1reaction
phil-scott-78commented, Feb 5, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command-line completion
Command-line completion (also tab completion) is a common feature of command-line interpreters, in which the program automatically fills in partially typed ...
Read more >
Tab completion for System.CommandLine
Once the user does this, tab completion is automatic for static values in your app, such as enum values or values you define...
Read more >
Command completion - AWS Command Line Interface
To prompt command completion, you partially enter in a command and press the completion key, which is typically Tab in most shells. The...
Read more >
Add tab autocomplete for your commandline apps
How to add autocomplete to your commandline apps for Linux by writing completion files for shell.
Read more >
Use Tab Completion to Type Commands Faster on Any ...
It's simple -- basically, it's all about tapping Tab while typing something at a command line to make the shell guess what you'll...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found