diff --git a/command/apply.go b/command/apply.go new file mode 100644 index 000000000..d93537777 --- /dev/null +++ b/command/apply.go @@ -0,0 +1,37 @@ +package command + +import ( + "strings" + + "github.com/mitchellh/cli" +) + +// ApplyCommand is a Command implementation that applies a Terraform +// configuration and actually builds or changes infrastructure. +type ApplyCommand struct { + Ui cli.Ui +} + +func (c *ApplyCommand) Run(_ []string) int { + return 0 +} + +func (c *ApplyCommand) Help() string { + helpText := ` +Usage: terraform apply [terraform.tf] + + Builds or changes infrastructure according to the Terraform configuration + file. + +Options: + + -init If specified, it is okay to build brand new infrastructure + (with no state file specified). + +` + return strings.TrimSpace(helpText) +} + +func (c *ApplyCommand) Synopsis() string { + return "Builds or changes infrastructure according to Terrafiles" +} diff --git a/commands.go b/commands.go index 73e9862d6..5e8605c05 100644 --- a/commands.go +++ b/commands.go @@ -14,6 +14,12 @@ func init() { ui := &cli.BasicUi{Writer: os.Stdout} Commands = map[string]cli.CommandFactory{ + "apply": func() (cli.Command, error) { + return &command.ApplyCommand{ + Ui: ui, + }, nil + }, + "version": func() (cli.Command, error) { return &command.VersionCommand{ Revision: GitCommit,