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

Make tab completions work in zsh #19

Merged
merged 1 commit into from
Nov 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions paasta_tools/paasta_cli/paasta_tabcomplete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if [[ -n ${ZSH_VERSION-} ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Does zsh parse /etc/profile.d/*.sh? Not *.zsh? I have no idea

autoload -U +X bashcompinit && bashcompinit
fi

# This magic eval enables tab-completion for the "paasta" command
# http://argcomplete.readthedocs.org/en/latest/index.html#synopsis
# This comes from the paasta-tools system package
Expand Down
2 changes: 1 addition & 1 deletion yelp_package/dockerfiles/lucid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ MAINTAINER Kyle Anderson <[email protected]>
# Make sure we get a package suitable for building this package correctly.
# Per dnephin we need https://github.com/spotify/dh-virtualenv/pull/20
# Which at this time is in this package
RUN apt-get update && apt-get -y install dpkg-dev python-tox python-setuptools python-dev debhelper dh-virtualenv=0.6-yelp2 python-yaml python-pytest pyflakes python2.7 python2.7-dev help2man
RUN apt-get update && apt-get -y install dpkg-dev python-tox python-setuptools python-dev debhelper dh-virtualenv=0.6-yelp2 python-yaml python-pytest pyflakes python2.7 python2.7-dev help2man zsh

ENV HOME /work
ENV PWD /work
Expand Down
2 changes: 1 addition & 1 deletion yelp_package/dockerfiles/trusty/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
FROM ubuntu:trusty
RUN apt-get update && apt-get -y install dpkg-dev python-tox python-setuptools \
python-dev debhelper python-yaml python-pytest pyflakes \
help2man
help2man zsh

# Older versions of dh-virtualenv are buggy and don't.. work
RUN curl http://ppa.launchpad.net/dh-virtualenv/daily/ubuntu/pool/main/d/dh-virtualenv/dh-virtualenv_0.10-0~80~ubuntu14.04.1_all.deb --output dh-virtualenv_0.10-0~80~ubuntu14.04.1_all.deb && \
Expand Down
7 changes: 7 additions & 0 deletions yelp_package/itest/tab_complete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ else
tab_complete_fail "$pre_typed" "$actual" "$expected"
fi

# Test tab completion in zsh
zsh_actual=$(zsh -c "COMP_LINE='paasta $pre_typed' COMP_POINT=99 _ARGCOMPLETE=1 paasta 8>&1 9>/dev/null")
if [[ $expected == $zsh_actual ]]; then
tab_complete_pass "$pre_typed"
else
tab_complete_fail "$pre_typed" "$zsh_actual" "$expected"
fi

# laziness test
#
Expand Down