From e65eeae6515fad9d6861df184035c9f656a02848 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 27 May 2019 21:57:42 +0700 Subject: awwan: the configuration management for local and cloud awwan is command line interface to configurate and manage remote system through SSH connection. --- script_example_test.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 script_example_test.go (limited to 'script_example_test.go') diff --git a/script_example_test.go b/script_example_test.go new file mode 100644 index 0000000..472f439 --- /dev/null +++ b/script_example_test.go @@ -0,0 +1,35 @@ +// Copyright 2019, Shulhan . All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package awwan + +import ( + "fmt" +) + +func Examplescript_join() { + envContent := ` +[section] +key=value +` + + scriptContent := ` +multiline\ +command {{.Val "section::key"}};\ +end; +` + env := &Environment{} + env.parseEnvironment([]byte(envContent)) + + s := parseScript(env, []byte(scriptContent)) + + for _, stmt := range s.Statements { + fmt.Printf("%s\n", stmt) + } + // Output: + // + // multiline command value; end; + // + // +} -- cgit v1.3-5-g9baa