main: fix the help output to show up

This commit is contained in:
Mitchell Hashimoto 2014-06-26 10:24:32 -07:00
parent 8cd4814beb
commit 92e1e09a69
2 changed files with 11 additions and 6 deletions

View File

@ -38,11 +38,11 @@ func resource_aws_instance_create(
// properly.
rs := s.MergeDiff(d)
// Create the instance
runOpts := &ec2.RunInstances{
ImageId: rs.Attributes["ami"],
InstanceType: rs.Attributes["instance_type"],
}
log.Printf("[DEBUG] Run configuration: %#v", runOpts)
runResp, err := ec2conn.RunInstances(runOpts)
if err != nil {
@ -52,8 +52,7 @@ func resource_aws_instance_create(
instance := &runResp.Instances[0]
log.Printf("[INFO] Instance ID: %s", instance.InstanceId)
// Store the resource state now so that we can return it in the case
// of any errors.
// Store the resulting ID so we can look this up later
rs.ID = instance.InstanceId
// Wait for the instance to become running so we can get some attributes

12
main.go
View File

@ -100,9 +100,10 @@ func wrappedMain() int {
}
cli := &cli.CLI{
Args: args,
Commands: Commands,
HelpFunc: cli.BasicHelpFunc("terraform"),
Args: args,
Commands: Commands,
HelpFunc: cli.BasicHelpFunc("terraform"),
HelpWriter: os.Stdout,
}
exitCode, err := cli.Run()
@ -131,7 +132,12 @@ func copyOutput(r io.Reader) {
if err != nil {
panic(err)
}
defaultR, err := pr.Prefix("")
if err != nil {
panic(err)
}
go io.Copy(os.Stderr, stderrR)
go io.Copy(os.Stdout, stdoutR)
go io.Copy(os.Stdout, defaultR)
}