Add an "embed" tag.

This commit is contained in:
Alec Thomas
2018-09-19 13:23:18 +10:00
parent 0ba159f97d
commit 54338bd8b1
5 changed files with 31 additions and 1 deletions
+11
View File
@@ -138,3 +138,14 @@ func TestTagSetOnCommand(t *testing.T) {
require.NoError(t, err)
require.Contains(t, buf.String(), `A key from somewhere.`)
}
func TestTagSetOnFlag(t *testing.T) {
var cli struct {
Flag string `set:"where=somewhere" help:"A key from ${where}."`
}
buf := &strings.Builder{}
p := mustNew(t, &cli, kong.Writers(buf, buf), kong.Exit(func(int) {}))
_, err := p.Parse([]string{"--help"})
require.NoError(t, err)
require.Contains(t, buf.String(), `A key from somewhere.`)
}