pulumi/pkg/compiler/opts.go
joeduffy cb9c152104 Permit passing stack properties via the CLI
If compiling a stack that accepts properties directly, we need a way to
pass arguments to that stack at the command line.  This change permits this
using the ordinary "--" style delimiter; for example:

        $ mu build -- --name=Foo

This is super basic and doesn't handle all the edge cases, but is sufficient
for testing and prototyping purposes.
2016-11-29 15:27:02 -08:00

24 lines
803 B
Go

// Copyright 2016 Marapongo, Inc. All rights reserved.
package compiler
import (
"github.com/marapongo/mu/pkg/compiler/backends"
"github.com/marapongo/mu/pkg/diag"
)
// Options contains all of the settings a user can use to control the compiler's behavior.
type Options struct {
Diag diag.Sink // a sink to use for all diagnostics.
SkipCodegen bool // if true, no code-generation phases run.
Arch backends.Arch // a target cloud architecture.
Cluster string // a named cluster with predefined settings to target.
Args map[string]string // optional arguments passed at the CLI.
}
// DefaultOpts returns the default set of compiler options.
func DefaultOpts(pwd string) Options {
return Options{
Diag: diag.DefaultSink(pwd),
}
}