Commit 496d1fe9 authored by Seth Vargo's avatar Seth Vargo

Merge pull request #1756 from StefanScherer/fix/packer-minus-minus-version

fixed `packer --version` to show version again
parents 88d48151 8b10e70b
...@@ -166,6 +166,7 @@ func wrappedMain() int { ...@@ -166,6 +166,7 @@ func wrappedMain() int {
Commands: Commands, Commands: Commands,
HelpFunc: cli.BasicHelpFunc("packer"), HelpFunc: cli.BasicHelpFunc("packer"),
HelpWriter: os.Stdout, HelpWriter: os.Stdout,
Version: Version,
} }
exitCode, err := cli.Run() exitCode, err := cli.Run()
......
...@@ -17,20 +17,20 @@ load test_helper ...@@ -17,20 +17,20 @@ load test_helper
[[ "$output" == *"Packer v"* ]] [[ "$output" == *"Packer v"* ]]
run packer -v run packer -v
[ "$status" -eq 0 ] [ "$status" -eq 1 ]
[[ "$output" == *"Packer v"* ]] [[ "$output" =~ ([0-9]+\.[0-9]+) ]]
run packer --version run packer --version
[ "$status" -eq 0 ] [ "$status" -eq 1 ]
[[ "$output" == *"Packer v"* ]] [[ "$output" =~ ([0-9]+\.[0-9]+) ]]
} }
@test "cli: packer version show help" { @test "cli: packer version show help" {
run packer version -h run packer version -h
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" == *"usage: packer version"* ]] [[ "$output" == *"Packer v"* ]]
run packer version --help run packer version --help
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[[ "$output" == *"usage: packer version"* ]] [[ "$output" == *"Packer v"* ]]
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment