Checklist
What problem does this solve?
I would like to be able to add additional topics to generated help messages.
Solution description
A good way would look something like this:
...
return &cli.Command{
Name: "set",
Topics: []cli.HelpTopics{
&cli.HelpTopic{ // must be a map[string]string
Reference: `https://example.com/api/overview`,
}
},
...
Which would generate:
NAME:
esctl cluster settings set - set|update cluster settings
REFERENCE:
https://example.com/api/overview
..
Describe alternatives you've considered
I am currently doing this:
return &cli.Command{
Name: "set",
Usage: "set|update cluster settings",
Aliases: []string{"set", "update"},
UsageText: "set [options] setting:value [setting:value ...]\nReference: " + SETTINGS,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "persistent",
Usage: "add persistent setting[s] (default)",
Destination: &conf.Persistent,
Aliases: []string{"p"},
},
&cli.BoolFlag{
Name: "transient",
Usage: "add transient setting[s]",
Destination: &conf.Transient,
Aliases: []string{"t"},
},
},
which outputs:
NAME:
esctl cluster settings set - set|update cluster settings
USAGE:
set [options] setting:value [setting:value ...]
Reference: https://www.elastic.co/docs/reference/elasticsearch/configuration-reference
OPTIONS:
--persistent, -p add persistent setting[s] (default)
--transient, -t add transient setting[s]
--help, -h show help
So, the reference is just part of the usage. I could add it to the NAME topic, but this would be wrong as well.
Checklist
What problem does this solve?
I would like to be able to add additional topics to generated help messages.
Solution description
A good way would look something like this:
Which would generate:
Describe alternatives you've considered
I am currently doing this:
which outputs:
So, the reference is just part of the usage. I could add it to the NAME topic, but this would be wrong as well.