Skip to content

Commit

Permalink
fixed packer --version
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanScherer committed Dec 13, 2014
1 parent 88d4815 commit 8b10e70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ func wrappedMain() int {
Commands: Commands,
HelpFunc: cli.BasicHelpFunc("packer"),
HelpWriter: os.Stdout,
Version: Version,
}

exitCode, err := cli.Run()
Expand Down
12 changes: 6 additions & 6 deletions test/cli.bats
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ load test_helper
[[ "$output" == *"Packer v"* ]]

run packer -v
[ "$status" -eq 0 ]
[[ "$output" == *"Packer v"* ]]
[ "$status" -eq 1 ]
[[ "$output" =~ ([0-9]+\.[0-9]+) ]]

run packer --version
[ "$status" -eq 0 ]
[[ "$output" == *"Packer v"* ]]
[ "$status" -eq 1 ]
[[ "$output" =~ ([0-9]+\.[0-9]+) ]]
}

@test "cli: packer version show help" {
run packer version -h
[ "$status" -eq 0 ]
[[ "$output" == *"usage: packer version"* ]]
[[ "$output" == *"Packer v"* ]]

run packer version --help
[ "$status" -eq 0 ]
[[ "$output" == *"usage: packer version"* ]]
[[ "$output" == *"Packer v"* ]]
}

0 comments on commit 8b10e70

Please sign in to comment.