Fish completion support for the fx
tool. Subcommands, their short and long options and descriptions for both are parsed from help documentation.
Sourcing the fx-env.fish
will load completions for you:
source ~/fuchsia/scripts/fx-env.fish
First attempt at fx
tab completion will hang while completions are generated. Subsequent tab completions will be fast as they are cached by fish. If you wish to regenerate this cache open a new shell or touch the fx.fish
file:
touch $FUCHSIA_DIR/scripts/fish/completions/fx.fish
If you wish to use only the fx.fish
file and avoid sourcing ~/fuchsia/scripts/fx-env.fish
you can do the following:
$FUCHSIA_DIR
to your fuchsia tree location. This can be done with a universal environment variable.set -U FUCHSIA_DIR $HOME/fuchsia
fx.fish
to any completion directory as described in the fish manual. Valid locations are contained in the $fish_complete_path
variable.For example:
mkdir -p ~/.config/fish/completions/ ln -s ~/fuchsia/scripts/fish/completions/fx.sh ~/.config/fish/completions/