command/build: Help text

This commit is contained in:
Mitchell Hashimoto 2013-06-02 15:17:04 -07:00
parent 74d812a766
commit 6bcd5de6f5
2 changed files with 12 additions and 3 deletions

View File

@ -5,18 +5,19 @@ import (
"github.com/mitchellh/packer/packer"
"io/ioutil"
"log"
"strings"
"sync"
)
type Command byte
func (Command) Help() string {
return "help"
return strings.TrimSpace(helpText)
}
func (Command) Run(env packer.Environment, args []string) int {
func (c Command) Run(env packer.Environment, args []string) int {
if len(args) != 1 {
env.Ui().Error("A single template argument is required.")
env.Ui().Say(c.Help())
return 1
}

8
command/build/help.go Normal file
View File

@ -0,0 +1,8 @@
package build
const helpText = `
Usage: packer build TEMPLATE
Will execute multiple builds in parallel as defined in the template.
The various artifacts created by the template will be outputted.
`