Setting Up Command Completion for the d4st Command

You can set up tab completion for the parameters to the d4st command.

The bash shell includes a general tab completion feature that can be set up for any command. The D4ST project includes a completion script for the d4st command, bash_completion.d/d4st.bash-completion.

To set up command completion for the d4st command you link or copy the d4st.bash-completion to the appropriate directory for your bash environment.

In addition, the d4st command must be in your PATH environment variable.

Command Completion Setup: macOS

You must have bash completion installed. See http://davidalger.com/development/bash-completion-on-os-x-with-brew/ for instructions on using homebrew to install bash completion if you haven't already.

To install the completion file link the d4st.bash-completion file to /etc/bash_completion.d/d4st:
$ cd d4st/bash_completion.d
$ ln -s $PWD/d4st.bash-completion `brew --prefix`/etc/bash_completion.d/d4st
$ source `brew --prefix`/etc/bash_completion.d/d4st
You should now be able to type "d4st", space, and tab to get a list of available options:
Mako:bash_completion.d ekimber$ d4st 
addhooks             cleanimages          gitlab               log-gitlab           pause                stop                 up                   
cleanall             down                 kill                 make-gitlab-project  pull                 test-gitlab          
cleancontainers      getdemo              linkmgr              make-gitlab-user     start                unpause              
Mako:bash_completion.d ekimber$ d4st

Command Completion Setup: Windows git bash shell

Not entirely sure what the best way to set this up permanently is.

One solution is to create or update your ~/.bash_profile to source the d4st.bash-completion file so that your ~/.bash_profile looks like this:
$ cat ~/.bash_profile
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
export PATH=$PATH:/c/Users/ekimber/apps/d4st-docker
source "/c/Users/ekimber/apps/d4st-docker/bash_completion.d/d4st.bash-completion"
$
You should now be able to type "d4st", space, and tab to get a list of available options:
ekimber@WIN-HH0I81E3DAU MINGW64 /
$ d4st
addhooks             getdemo              make-gitlab-project  stop
cleanall             gitlab               make-gitlab-user     test-gitlab
cleancontainers      kill                 pause                unpause
cleanimages          linkmgr              pull                 up
down                 log-gitlab           start

ekimber@WIN-HH0I81E3DAU MINGW64 / 

Command Completion Setup: Linux

To install the completion file link the d4st.bash-completion file to /etc/bash_completion.d/d4st:
$ cd d4st/bash_completion.d
$ sudo ln -s $PWD/d4st.bash-completion /etc/bash_completion.d/d4st
You should now be able to type "d4st", space, and tab to get a list of available options:
ekimber@WIN-HH0I81E3DAU:/mnt/c/Users/ekimber/apps/d4st-docker$ d4st
addhooks             down                 linkmgr              pause                test-gitlab
cleanall             getdemo              log-gitlab           pull                 unpause
cleancontainers      gitlab               make-gitlab-project  start                up
cleanimages          kill                 make-gitlab-user     stop
ekimber@WIN-HH0I81E3DAU:/mnt/c/Users/ekimber/apps/d4st-docker$