Skip to content
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

Shell autocompletion #14

Open
marchellodev opened this issue Nov 6, 2023 · 1 comment
Open

Shell autocompletion #14

marchellodev opened this issue Nov 6, 2023 · 1 comment

Comments

@marchellodev
Copy link

It would be great to have autocomplete when pressing tab to autocomplete for the command name or the service name for both zsh and bash.

For reference: https://askubuntu.com/questions/68175/how-to-create-script-with-auto-complete

@secretshardul
Copy link
Contributor

Autocomplete for commands can be implemented with clap_complete but I have questions:

  1. Do we really need auto-complete for core commands like ser create, ser start or ser stop? The commands are short, also some of them have the same starting characters (st in start / stop / status). This defeats the point of auto-complete.

  2. There's value in auto-completion for service names. ser stop hel gets auto-completed to ser stop hello-world. The problem is that clap_help won't help not help because we need to read files from /etc/systemd/system/ and match them with the input text. We must write completion scripts by hand and need separate scripts for every shell editor (bash, zsh).

Got a few things at hand but will try to make time for #2. In the meantime contributions are appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants