1 Star 0 Fork 0

飞光梁/packer-zsh-completion

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
_packer 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
gkze 提交于 2014-12-30 14:32 . Adding new commands
#compdef packer
__json_template() {
declare -a template
template=($(ls | grep '.json'))
_describe 'images' template
}
local -a _packer_cmds
_packer_cmds=(
'build:Build commands.'
'fix:Repair templates from old versions of packer.'
'inspect:View template in human readable form.'
'push:Push to a remote packer host to build template.'
'validate:Check that a template is valid.'
'version:Display packer version.'
)
__build() {
_arguments \
'-debug[Enable Debug mode.]' \
'-force[Force a build delete existing artifacts.]' \
'-machine-readable[Enable machine-readable output.]' \
'-except=[Do not build specifed builds.]' \
'-only=[Build only specified builds.]' \
'-parallel=[Disable parallelization (default: true).]' \
'-var[Set variable in template.]' \
'-var-file=[Set JSON file containing user variables.]'
__json_template
}
__fix() {
__json_template
}
__inspect() {
_arguments \
'-machine-readable[Enable machine-readable output.]'
__json_template
}
__push() {
_arguments \
'-create[Create the build configuration if it does not exist.]' \
'-token=[Access token to use to upload. If blank, the ATLAS_TOKEN environmental variable will be used.]'
}
__validate() {
_arguments \
'-syntax-only[Check syntax only.]' \
'-except=[Do not validate specifed builds.]' \
'-only=[Validate only specified builds.]' \
'-var[Set variable in template.]' \
'-var-file=[Set JSON file containing user variables.]'
__json_template
}
__version() {
true
}
_arguments '*:: :->command'
if (( CURRENT == 1 )); then
_describe -t commands "packer command" _packer_cmds
return
fi
local -a _command_args
case "$words[1]" in
build)
__build ;;
fix)
__fix ;;
inspect)
__inspect ;;
push)
__push ;;
validate)
__validate ;;
version)
__version ;;
esac
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lgf1244/packer-zsh-completion.git
[email protected]:lgf1244/packer-zsh-completion.git
lgf1244
packer-zsh-completion
packer-zsh-completion
master

搜索帮助