如何在 Fish shell 中完成 doctl 工作?

问题描述 投票:0回答:1

doctl 是 digitalocean cli 工具,用于通过 CLI 与 digitalocean 资源进行交互。

它内置了完成选项,例如您可以运行此命令来启用 bash 完成

doctl completion bash > /etc/bash_completion.d/doctl

(可能需要 sudo tee 右侧)

但我一直无法弄清楚如何让 Fish shell 工作自动完成。

doctl cli 不提供语法或示例命令。

我试过了,但没用

doctl completion fish > .config/fish/completions/doctl
autocomplete digital-ocean fish
1个回答
0
投票

我试过了,但没用 doctl 补全鱼 > .config/fish/completions/doctl

几乎是对的。完成文件需要有“.fish”扩展名:

doctl completion fish > ~/.config/fish/completions/doctl.fish

(我还添加了

~/
以使其成为绝对路径)

© www.soinside.com 2019 - 2024. All rights reserved.