Add support for setting variables via tag.

This provides much more convenient composition when reusing structs in
different parts of the command grammar.

eg.

	type Embedded struct {
		Key string `help:"A key from ${where}."`
	}

	var cli struct {
		Embedded `set:"where=somewhere"`
	}
This commit is contained in:
Alec Thomas
2018-09-19 12:56:12 +10:00
parent 467352418f
commit 2e29ff8981
9 changed files with 134 additions and 50 deletions
+7
View File
@@ -0,0 +1,7 @@
module github.com/alecthomas/kong
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.2.2
)