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

Add completion for bash & zsh #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tyler71
Copy link
Contributor

@tyler71 tyler71 commented Sep 28, 2020

Created to address #5

I changed the install shell to bash to be able to do if checks with multiple comparisons. I'm not sure this is possible in sh

For a completion script to be installed, a few conditions need to be met:

  • The shell should be installed
  • docker installed and the user part of the docker group

Additional message for zsh users to include bashcompinit

zsh version has autocompletion, bash will simply list all existing images.

The bash completions script is added to /etc/bash_completion.d/dockit
zsh is added to /usr/share/zsh/vendor-completions/_dockit


I've tested both in the ubuntu image and they seem to be working well.
Bash needs bash-completion installed and zsh needs bashcompinit in ~/.zshrc.
Make sure if testing to switch to a non-root user.

For a completion script to be installed, a few conditions need to be met
* The shell should be installed
* docker installed and the user part of the docker group

Additional message for zsh users to include bashcompinit

zsh version has autocompletion, bash will simply list all existing images.
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.

1 participant