1 Star 0 Fork 0

OPLG / DataKit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
datakit-completer.sh 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
coanor 提交于 2023-04-22 00:56 . docs: fix datakit command docs
# DataKit completion -*- shell-script -*-
# We should copy this script to /etc/bash_completion.d/datakit for unbuntu
# For Centos relalted Linux, we need more test.
_datakit()
{
local cur_word prev_word
cur_word="${COMP_WORDS[COMP_CWORD]}"
prev_word="${COMP_WORDS[COMP_CWORD-1]}"
cmd=${COMP_WORDS[1]}
if [[ -n $cmd ]]; then # we have select specified command
case "${cmd}" in
dql)
COMPREPLY=( $(compgen -W '--auto-json --csv -F,--force --host -J,--json --log -R,--run -T,--token -V,--verbose' -- "${cur_word}") )
;;
pipeline)
COMPREPLY=( $(compgen -W '--date -F,--file --log --tab -T,--txt' -- "${cur_word}") )
;;
monitor)
COMPREPLY=( $(compgen -W '-I,--input --log -W,--max-table-width -R,--refresh --to -V,--verbose' -- "${cur_word}") )
;;
service)
COMPREPLY=( $(compgen -W '--log -I,--reinstall -R,--restart -S,--start -T,--stop -U,--uninstall' -- "${cur_word}") )
;;
install)
COMPREPLY=( $(compgen -W '--log --ipdb --log --scheck --telegraf' -- "${cur_word}") )
;;
tool)
COMPREPLY=( $(compgen -W '--default-main-conf --dump-samples --ipinfo --log
--show-cloud-info --upload-log --workspace-info --setup-completer-script' -- "${cur_word}") )
;;
help)
COMPREPLY=( $(compgen -W 'dql run pipeline service monitor install tool' -- "${cur_word}") )
;;
*)
COMPREPLY=( $(compgen -W 'dql run pipeline service monitor install tool help' -- "${cur_word}") )
;;
esac
else # command not selected
COMPREPLY=( $(compgen -W 'dql run pipeline service monitor install tool help' -- "${cur_word}") )
fi
} &&
complete -F _datakit datakit ddk
# ex: filetype=sh
1
https://gitee.com/oplg/datakit.git
git@gitee.com:oplg/datakit.git
oplg
datakit
DataKit
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891