mitchellh/packer — pull request #1756 by StefanScherer (2014-12-13 18:53:54+00:00)
Title: fixed `packer --version` to show version again

As mentioned by @kensykora in #1753 I also first tried a `packer --version` after upgrading to Packer 0.7.5 and only got the usage, but no version number.

I also found the BATS script `test/cli.bats` which checks some packer options. This test script shows errors:

```bash
$ test/cli.bats
✓ cli: packer should show help
✗ cli: packer version
(in test file test/cli.bats, line 24)
`[ "$status" -eq 1 ]' failed
Executing: packer version
Packer v0.7.5
Executing: packer -v
usage: packer [--version] [--help] []
Available commands are:
build build image(s) from template
fix fixes templates from old versions of packer
inspect see components of a template
push push template files to a Packer build service
validate check that a template is valid
version Prints the Packer version
Executing: packer --version
usage: packer [--version] [--help] []
Available commands are:
build build image(s) from template
fix fixes templates from old versions of packer
inspect see components of a template
push push template files to a Packer build service
validate check that a template is valid
version Prints the Packer version
✓ cli: packer version show help
```

In the `main.go` I only added the `Version` field and now packer shows at least the version number:

```bash
$ packer version
Packer v0.7.5

$ packer --version
0.7.5

$ packer -v
0.7.5

$ echo $?
1
```

I have updated the `test/cli.bats` script as well to make the test work.