From 49256895ccc1add31412fc5ab7b05ea2382cfac8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 15 Apr 2013 15:03:41 -0700 Subject: [PATCH] CLI calls should slice the first arg out before running --- packer/environment.go | 2 +- packer/environment_test.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packer/environment.go b/packer/environment.go index fd2bb5feb..819c8dd63 100644 --- a/packer/environment.go +++ b/packer/environment.go @@ -74,7 +74,7 @@ func (e *Environment) Cli(args []string) int { } } - return command.Run(e, args) + return command.Run(e, args[1:]) } // Prints the CLI help to the UI. diff --git a/packer/environment_test.go b/packer/environment_test.go index 67cc4d373..fc62c692c 100644 --- a/packer/environment_test.go +++ b/packer/environment_test.go @@ -6,6 +6,17 @@ import ( "testing" ) +func testEnvironment() *Environment { + return NewEnvironment() +} + +func TestEnvironment_Cli_CallsRun(t *testing.T) { + //_ := asserts.NewTestingAsserts(t, true) + + // TODO: Test that the call to `Run` is done with + // proper arguments and such. +} + func TestEnvironment_DefaultCli_Empty(t *testing.T) { assert := asserts.NewTestingAsserts(t, true)