cmd
cmd copied to clipboard
Make documentation an adaptor rather than implicit.
This is another breaking change.
The documentation command should not be instantiated for every command supercommand. Every binary or sub-super command that implements the super command now has a documentation command. This includes things like jujud, container-agent, etc.
Instead, a documentation command should be added to the super command base as an adapter. Ideally, the documentation command should be in a sub-package, so that it can be used in isolation.
An example of this should be:
waitFor := cmd.NewSuperCommand(cmd.SuperCommandParams{
Name: "wait-for",
UsagePrefix: "juju",
Doc: waitForDoc,
Purpose: "Wait for an entity to reach a specified state.",
Documentation: documentation.NewMarkdown(),
})
If there is no documentation, it doesn't do anything. This is purely additive.