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

Built-in generation of bash completions #32

Open
carnesen opened this issue Jun 2, 2020 · 0 comments
Open

Built-in generation of bash completions #32

carnesen opened this issue Jun 2, 2020 · 0 comments
Labels
enhancement An idea for how the software could be better main Pertains to @carnesen/cli package
Milestone

Comments

@carnesen
Copy link
Owner

carnesen commented Jun 2, 2020

Now that we have come so far with the autocomplete functionality for CliRepl, it would be awesome if we leverage that command completion for Node.js CLIs executed in bash.

We could offer a CLI command to get these autocompletions into a shell that would look something like (for a CLI my-cli):

completionsCommand = CliCommand({
  name: 'completions',
  action() {
    return `
# This command is meant to be used as "eval $(my-cli completions)"
command -W ...
`

The user would do:

$ eval $(my-cli completions)

https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html
Personally I still use bash, but probably we could/should do this for other shells too.

@carnesen carnesen changed the title Feature request: Built-in generation of command-line completions Built-in generation of command-line completions Jun 2, 2020
@carnesen carnesen added the enhancement An idea for how the software could be better label Jun 2, 2020
@carnesen carnesen changed the title Built-in generation of command-line completions Built-in generation of bash completions Jun 21, 2020
@carnesen carnesen added the main Pertains to @carnesen/cli package label Jun 22, 2020
@carnesen carnesen added this to the 0.6.0 milestone Jul 4, 2020
@carnesen carnesen changed the title Built-in generation of bash completions Built-in generation of bash+zsh completions Aug 4, 2020
@carnesen carnesen changed the title Built-in generation of bash+zsh completions Built-in generation of bash completions Feb 7, 2021
@carnesen carnesen modified the milestones: 1.0, Backlog May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An idea for how the software could be better main Pertains to @carnesen/cli package
Projects
None yet
Development

No branches or pull requests

1 participant