Commit 6bcd5de6 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

command/build: Help text

parent 74d812a7
...@@ -5,18 +5,19 @@ import ( ...@@ -5,18 +5,19 @@ import (
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"io/ioutil" "io/ioutil"
"log" "log"
"strings"
"sync" "sync"
) )
type Command byte type Command byte
func (Command) Help() string { 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 { if len(args) != 1 {
env.Ui().Error("A single template argument is required.") env.Ui().Say(c.Help())
return 1 return 1
} }
......
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.
`
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment