From 56be8dd63eee58d7ff4273487c4a50c35e1383b2 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Thu, 19 Sep 2024 11:44:10 +0200 Subject: [PATCH] docs: provide instructions for autocomplete --- docs/tfctl.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/tfctl.md b/docs/tfctl.md index 90fcccf2..4cf560a0 100644 --- a/docs/tfctl.md +++ b/docs/tfctl.md @@ -38,3 +38,41 @@ Flags: Use "tfctl [command] --help" for more information about a command. ``` + +## Shell completion + +It works the same way as flux CLI: + +With **bash**: + +```shell +# ~/.bashrc or ~/.profile +command -v tfctl >/dev/null && . <(tfctl completion bash) +``` + +With **fish**: + +```shell +tfctl completion fish > ~/.config/fish/completions/tfctl.fish +``` + +With **powershell**: + +```shell +# Windows + +cd "$env:USERPROFILE\Documents\WindowsPowerShell\Modules" +tfctl completion powershell >> tfctl-completion.ps1 + +# Linux + +cd "${XDG_CONFIG_HOME:-"$HOME/.config/"}/powershell/modules" +tfctl completion powershell >> tfctl-completions.ps1 +``` + +With **zsh**: + +```shell +# ~/.zshrc or ~/.profile +command -v tfctl >/dev/null && . <(tfctl completion zsh) +```