From f49c0cb313669183bc65c36f605203e80643c694 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 21 Apr 2013 18:45:44 -0700 Subject: [PATCH] Pull out Command interface out into separate file --- packer/command.go | 20 ++++++++++++++++++++ packer/environment.go | 18 ------------------ 2 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 packer/command.go diff --git a/packer/command.go b/packer/command.go new file mode 100644 index 000000000..58857098f --- /dev/null +++ b/packer/command.go @@ -0,0 +1,20 @@ +package packer + +// A command is a runnable sub-command of the `packer` application. +// When `packer` is called with the proper subcommand, this will be +// called. +// +// The mapping of command names to command interfaces is in the +// Environment struct. +// +// Run should run the actual command with the given environmet and +// command-line arguments. It should return the exit status when it is +// finished. +// +// Synopsis should return a one-line, short synopsis of the command. +// This should be less than 50 characters ideally. +type Command interface { + Run(env *Environment, args []string) int + Synopsis() string +} + diff --git a/packer/environment.go b/packer/environment.go index d9f47d2fe..7caa96fba 100644 --- a/packer/environment.go +++ b/packer/environment.go @@ -9,24 +9,6 @@ import ( "strings" ) -// A command is a runnable sub-command of the `packer` application. -// When `packer` is called with the proper subcommand, this will be -// called. -// -// The mapping of command names to command interfaces is in the -// Environment struct. -// -// Run should run the actual command with the given environmet and -// command-line arguments. It should return the exit status when it is -// finished. -// -// Synopsis should return a one-line, short synopsis of the command. -// This should be less than 50 characters ideally. -type Command interface { - Run(env *Environment, args []string) int - Synopsis() string -} - // The environment struct contains all the state necessary for a single // instance of Packer. //