Setting up dfw command completion

The Deployment Framework’s dfw command utility supports Bash command completion using the Tab key.

Command completion is available in release 6.2 of the Deployment Framework and later.

For examples of how to use dfw command completion, see Completing dfw commands using the <tab> key in The Deployment Framework command utility (dfw).

Enabling command completion

Command completion can be enabled for your current session, for all your future sessions, or for all future sessions for all users.

Current session

To enable dfw command completion for the current session only, enter the command below from the root directory of your Deployment Framework.

$ source .dfw-completion

If running the script above does not enable command completion, try executing it in a new shell. In some versions of Bash, once standard filename completion is bound with the dfw command, it will remain bound for the duration of the session.

All future sessions

To enable dfw command completion for every time you login:

  1. Copy the file .dfw-completion from the root directory of your Deployment Framework into your home directory

  2. Add the following line to ~/.bash_profile

    . ~/.dfw-completion

All future sessions, for all users

To enable dfw command completion for all users, copy the file .dfw-completion from the root directory of your Deployment Framework to the /etc/bash_completion.d directory.

If your Linux distribution does not have a /etc/bash_completion.d directory, copy the file to /etc/profile.d instead.

If your Linux distribution has neither /etc/bash_completion.d nor /etc/profile.d, consult your system administrator.

When the Deployment Framework is upgraded…​

When you upgrade the Deployment Framework, the new release may include an updated version of the .dfw-completion script; for example, it may support new dfw commands that allow <tab> completion. If you previously copied the .dfw-completion script to another directory to enable command completion for future sessions, make sure you copy the new version of .dfw-completion to the appropriate directory to ensure command completion continues to work correctly.