about summary refs log tree commit diff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index 13aabd248d2d..ee70bdae55a8 100644
--- a/main.go
+++ b/main.go
@@ -37,6 +37,7 @@ var (
 	// Global flags
 	includes = app.Flag("include", "Resource sets to include explicitly").Short('i').Strings()
 	excludes = app.Flag("exclude", "Resource sets to exclude explicitly").Short('e').Strings()
+	variables = app.Flag("var", "Provide variables to templates explicitly").Strings()
 
 	// Commands
 	template          = app.Command("template", "Template resource sets and print them")
@@ -188,6 +189,11 @@ func loadContextAndResources(file *string) (*context.Context, *[]templater.Rende
 		app.Fatalf("Error loading context: %v\n", err)
 	}
 
+	err = ctx.SetVariablesFromArguments(variables)
+	if err != nil {
+		app.Fatalf("Error setting explicit variables in context: %v\n", err)
+	}
+
 	resources, err := templater.LoadAndApplyTemplates(includes, excludes, ctx)
 	if err != nil {
 		app.Fatalf("Error templating resource sets: %v\n", err)