Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tombrk
Copy link
Contributor

@tombrk tombrk commented Mar 14, 2019

This PR adds autocompletion support for bash and zsh.

Added Functionality

  • Subcommand completion for both shells
  • Filename completion for jk run -f in bash (yaml, yml, json). Cobra does not seem to support this in zsh at the moment.

Generating completions

  • bash: source <(jk completion)
  • zsh: jk completion zsh > _jk, then move _jk into $fpath and run compinit.

Closes #113

tombrk added 2 commits March 14, 2019 22:00
Adds completion command for generating full shell autocompletions:
- bash: Fully supported
- zsh: Only minimal support, related to cobra
Copy link
Member

@dlespiau dlespiau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! With two little changes this looks good to me!

  • Our CI linter tests the files are formatted with the -s gofmt option
  • Adding some instructions for zsh in the long help text

tombrk added 2 commits March 15, 2019 14:07
Fixes the formatting to accord to `gofmt -s`
@dlespiau
Copy link
Member

Thanks a lot for this contribution! Happily merging! :)

@dlespiau dlespiau merged commit b1f82db into jkcfg:master Mar 15, 2019
@tombrk tombrk deleted the cli-complete branch March 15, 2019 17:45
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

Successfully merging this pull request may close these issues.

2 participants