Merge remote-tracking branch 'upstream/master'

This commit is contained in:
S.Solodyagin
2025-07-02 20:54:46 +03:00
44 changed files with 1927 additions and 574 deletions
+7 -4
View File
@@ -7,14 +7,16 @@ import (
)
var cli struct {
Flag flagWithHelp `help:"Regular flag help"`
Flag flagWithHelp `help:"${flag_help}"`
Echo commandWithHelp `cmd:"" help:"Regular command help"`
}
type flagWithHelp bool
func (f *flagWithHelp) Help() string {
return "🏁 additional flag help"
// See https://github.com/alecthomas/kong?tab=readme-ov-file#variable-interpolation
var vars = kong.Vars{
"flag_help": "Extended flag help that might be too long for directly " +
"including in the struct tag field",
}
type commandWithHelp struct {
@@ -41,7 +43,8 @@ func main() {
kong.ConfigureHelp(kong.HelpOptions{
Compact: true,
Summary: false,
}))
}),
vars)
switch ctx.Command() {
case "echo <msg>":
fmt.Println(cli.Echo.Msg)