github.com/rahart/packer@v0.12.2-0.20161229105310-282bb6ad370f/contrib/zsh-completion/_packer (about)

     1  #compdef packer
     2  
     3  local -a _packer_cmds
     4  _packer_cmds=(
     5      'build:Build image(s) from template'
     6      'fix:Fixes templates from old versions of packer'
     7      'inspect:See components of a template'
     8      'push:Push template files to a Packer build service'
     9      'validate:Check that a template is valid'
    10      'version:Prints the Packer version'
    11  )
    12  
    13  __build() {
    14      _arguments \
    15        '-debug[Debug mode enabled for builds]' \
    16        '-force[Force a build to continue if artifacts exist, deletes existing artifacts]' \
    17        '-machine-readable[Machine-readable output]' \
    18        '-except=[(foo,bar,baz) Build all builds other than these]' \
    19        '-only=[(foo,bar,baz) Only build the given builds by name]' \
    20        '-parallel=[(false) Disable parallelization (on by default)]' \
    21        '-var[("key=value") Variable for templates, can be used multiple times.]' \
    22        '-var-file=[(path) JSON file containing user variables.]'
    23  }
    24  
    25  
    26  __inspect() {
    27    _arguments \
    28      '-machine-readable[Machine-readable output]' 
    29  }
    30  
    31  __push() {
    32    _arguments \
    33      '-name=[(<name>) The destination build in Atlas.]' \
    34      '-token=[(<token>) Access token to use to upload.]' \
    35      '-var[("key=value") Variable for templates, can be used multiple times.]' \
    36      '-var-file=[(path) JSON file containing user variables.]'
    37  }
    38  
    39  __validate() {
    40      _arguments \
    41        '-syntax-only[Only check syntax. Do not verify config of the template.]' \
    42        '-except=[(foo,bar,baz) Validate all builds other than these]' \
    43        '-only=[(foo,bar,baz) Validate only these builds]' \
    44        '-var[("key=value") Variable for templates, can be used multiple times.]' \
    45        '-var-file=[(path) JSON file containing user variables.]'
    46  }
    47  
    48  
    49  _arguments '*:: :->command'
    50  
    51  if (( CURRENT == 1 )); then
    52    _describe -t commands "packer command" _packer_cmds
    53    return
    54  fi
    55  
    56  local -a _command_args
    57  case "$words[1]" in
    58    build)
    59      __build ;;
    60    inspect)
    61      __inspect ;;
    62    push)
    63      __push ;;
    64    validate)
    65      __validate ;;
    66  esac