You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by GitBox <gi...@apache.org> on 2022/10/12 16:40:59 UTC

[GitHub] [buildstream] staehle opened a new pull request, #1775: Zsh tab-completions, with related doc changes

staehle opened a new pull request, #1775:
URL: https://github.com/apache/buildstream/pull/1775

   Hello, I found a related ticket for this: #558
   
   I primarily use Zsh with Prezto, and not having tab-completions was bothering me, so here you go :) 
   
   It just uses your existing Bash completion code, but rearranges it for Zsh's `compdef`. File name must be `_bst`, and I placed in a `zsh` directory in the same location as the bash `bst` script is. Hope that's okay.
   
   Also added related usage instructions to the docs.
   
   For future enhancements in this area, I would recommend doing tab-completions similar to how Poetry does it, but that's up to you:  https://python-poetry.org/docs/#enable-tab-completion-for-bash-fish-or-zsh 
   
   Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [buildstream] staehle commented on pull request #1775: Zsh tab-completions, with related doc changes

Posted by GitBox <gi...@apache.org>.
staehle commented on PR #1775:
URL: https://github.com/apache/buildstream/pull/1775#issuecomment-1276464635

   > please mention that it closes #558
   
   I did, and it's in the commit message


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [buildstream] staehle commented on a diff in pull request #1775: Zsh tab-completions, with related doc changes

Posted by GitBox <gi...@apache.org>.
staehle commented on code in PR #1775:
URL: https://github.com/apache/buildstream/pull/1775#discussion_r1014651832


##########
doc/source/main_install.rst:
##########
@@ -239,3 +243,41 @@ bash-completion installation path, which you can discover as follows::
 
 See the `bash-completion FAQ <https://github.com/scop/bash-completion#faq>`_
 for more information.
+
+Zsh completions
+~~~~~~~~~~~~~~~~
+
+Zsh completions are provided by the ``_bst`` completion script, available online
+(`src/buildstream/data/zsh/_bst <https://raw.githubusercontent.com/apache/buildstream/master/src/buildstream/data/zsh/_bst>`_)
+and in your local Git clone at ``src/buildstream/data/zsh/_bst``.
+
+Copy the above file to the completions location for your Zsh framework:
+
+**Prezto**::
+
+    cp src/buildstream/data/zsh/_bst ~/.zprezto/modules/completion/external/src/_bst
+
+You may have to reset your zcompdump cache, if you have one, and then restart your shell::
+
+    rm ~/.zcompdump ${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump
+
+**Oh My Zsh**::
+
+    mkdir $ZSH_CUSTOM/plugins/bst
+    cp src/buildstream/data/zsh/_bst $ZSH_CUSTOM/plugins/bst/_bst
+
+You must then add ``bst`` to your plugins array in ``~/.zshrc``::
+
+    plugins(
+      bst
+      ...
+    )
+
+**None**::

Review Comment:
   You're right, I did word that a bit confusing. I might be incorrectly assuming that everyone uses a framework with Zsh, so I reworded that to remove that assumption.
   Added one more commit to revise that (as well as rebasing to 1.95.4)! Hopefully that looks better!
   Thanks for the review!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [buildstream] abderrahim commented on a diff in pull request #1775: Zsh tab-completions, with related doc changes

Posted by GitBox <gi...@apache.org>.
abderrahim commented on code in PR #1775:
URL: https://github.com/apache/buildstream/pull/1775#discussion_r1014623180


##########
doc/source/main_install.rst:
##########
@@ -239,3 +243,41 @@ bash-completion installation path, which you can discover as follows::
 
 See the `bash-completion FAQ <https://github.com/scop/bash-completion#faq>`_
 for more information.
+
+Zsh completions
+~~~~~~~~~~~~~~~~
+
+Zsh completions are provided by the ``_bst`` completion script, available online
+(`src/buildstream/data/zsh/_bst <https://raw.githubusercontent.com/apache/buildstream/master/src/buildstream/data/zsh/_bst>`_)
+and in your local Git clone at ``src/buildstream/data/zsh/_bst``.
+
+Copy the above file to the completions location for your Zsh framework:
+
+**Prezto**::
+
+    cp src/buildstream/data/zsh/_bst ~/.zprezto/modules/completion/external/src/_bst
+
+You may have to reset your zcompdump cache, if you have one, and then restart your shell::
+
+    rm ~/.zcompdump ${XDG_CACHE_HOME:-$HOME/.cache}/prezto/zcompdump
+
+**Oh My Zsh**::
+
+    mkdir $ZSH_CUSTOM/plugins/bst
+    cp src/buildstream/data/zsh/_bst $ZSH_CUSTOM/plugins/bst/_bst
+
+You must then add ``bst`` to your plugins array in ``~/.zshrc``::
+
+    plugins(
+      bst
+      ...
+    )
+
+**None**::

Review Comment:
   This would be probably clearer as "No framework" or "Vanilla zsh". Also I don't know how people using zsh do it, but shouldn't this be the first one?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [buildstream] abderrahim commented on pull request #1775: Zsh tab-completions, with related doc changes

Posted by GitBox <gi...@apache.org>.
abderrahim commented on PR #1775:
URL: https://github.com/apache/buildstream/pull/1775#issuecomment-1276460104

   please mention that it closes https://github.com/apache/buildstream/issues/558


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [buildstream] gtristan merged pull request #1775: Zsh tab-completions, with related doc changes

Posted by "gtristan (via GitHub)" <gi...@apache.org>.
gtristan merged PR #1775:
URL: https://github.com/apache/buildstream/pull/1775


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org