[MacPorts] #56963: New keywords for bash/zsh tab-completion

MacPorts noreply at macports.org
Sun Aug 12 22:21:59 UTC 2018


#56963: New keywords for bash/zsh tab-completion
-------------------------+--------------------
 Reporter:  newtonne     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  Normal       |  Milestone:
Component:  base         |    Version:
 Keywords:               |       Port:
-------------------------+--------------------
 I see a lot of the same patterns used in Portfiles to install bash/zsh
 tab-completion. Would it not be better to have a keyword that could
 perform this functionality so that you just have to specify where the
 items are within the package. For example, something like:

 {{{
 bash_completion ${worksrcpath}/scripts/shell_completions/bash/borg
 zsh_completion ${worksrcpath}/scripts/shell_completions/zsh/_borg
 }}}

 Instead of:
 {{{
 post-destroot {
     set bash_compl_path ${prefix}/share/bash-completion/completions
     xinstall -d ${destroot}${bash_compl_path}
     xinstall -m 0644 ${worksrcpath}/scripts/shell_completions/bash/borg \
         ${destroot}${bash_compl_path}

     set zsh_compl_path ${prefix}/share/zsh/site-functions
     xinstall -d ${destroot}${zsh_compl_path}
     xinstall -m 0644 ${worksrcpath}/scripts/shell_completions/zsh/_borg \
         ${destroot}${zsh_compl_path}
 }
 }}}

 For bash completions, there is the complication of whether the file should
 be installed to ${prefix}/share/bash-completion/completions/ or
 ${prefix}/etc/bash_completion.d/, but this could be solved by using a
 bash_completion_compat keyword for the latter case.

 On the rare occasions where setting this up is more involved, the longer
 method could still be used.

-- 
Ticket URL: <https://trac.macports.org/ticket/56963>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list