For Mac _complete_ssh_hosts Compreply Cur

2020. 1. 25. 09:15카테고리 없음

For Mac _complete_ssh_hosts Compreply Cur _complete_ssh_hosts

I have tried for hours to get this working and feel like I've not come anywhere close. I am trying to shorten our workflow by tab-completing directory names from the Mac OS X Terminal. We have an internal tool, let's call it bob, that automatically runs commands on git submodules. What I'd like to do is get it to autocomplete the subdirectory names.

Complete -W '$(echo `cat ~/.ssh/known_hosts cut -f 1 -d ' ' sed -e s/. More:-) _ssh_complete () { local cur _get_comp_words_by_ref cur COMPREPLY=(. This will allow you to tab complete any hostname you've previously ssh'd to. [robg adds: This worked as described for me.The complete command is a built-in bash function that lets you specify lists of options to be used with tab completion on a given command.

CompreplyCurrent

For Mac _complete_ssh_hosts Compreply Cure

The problem is, those subdirectories live in a static location. Project directory -public -submodules -a-module -another-module -other-module -some-module Commands are run from the top project directory like so: bob start bugfix anothermodule Rather than having to fully type out 'anothermodule', which is what we currently do, I'd love to get tab autocomplete to work. We use this workflow many times per day and shaving seconds off of it would be great and avoid typos. The end goal is: bob start bugfix an would autocomplete to bob start bugfix anothermodule I've tried CDPATH but quickly realized this was not what I'm after, as this isn't following the cd command, only my custom command. I have bashcompletion installed but I am not very good at bash in general. Mentioning this though in case it can be a part of the solution!

For Mac _complete_ssh_hosts Compreply Cur