Setting up dfw command completion

This page describes how to enable dfw command completion, which extends Bash command-line completion to the dfw command's parameters. For examples of using dfw command completion, see Completing dfw commands using the <tab> key.

The script that enables dfw command completion also sets an environment variable that is required by Caplin's logcat command in some circumstances. See View packet logs using logcat: Requirements

Requirements

Deployment Framework 6.2 or later.

Enabling dfw command completion

You can enable dfw command completion for your current session only, or all future sessions:

Enable for your 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

Note: If running the script above does not enable dfw command completion, try executing it in a new Bash shell. In some versions of Bash, if Bash filename completion is used with the dfw command before sourcing the .dfw-completion file, then Bash filename completion remains bound to the dfw command for the duration of the shell session.

Enable for all future sessions

To enable dfw command completion for your future sessions:

  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
    1. . ~/.dfw-completion

Note: When you upgrade the Deployment Framework, the new release may include an updated version of the .dfw-completion script. Copy the new version of the .dfw-completion script to the appropriate directory to ensure command completion continues to work correctly.

Enable for all users' future sessions

To enable dfw command completion for all users's future sessions, 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 a /etc/bash_completion.d directory nor a /etc/profile.d directory, consult your system administrator.

Note: When you upgrade the Deployment Framework, the new release may include an updated version of the .dfw-completion script. Copy the new version of the .dfw-completion script to the appropriate directory to ensure command completion continues to work correctly.