Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make documentation an adaptor rather than implicit. #106

Open
SimonRichardson opened this issue Aug 14, 2023 · 0 comments
Open

Make documentation an adaptor rather than implicit. #106

SimonRichardson opened this issue Aug 14, 2023 · 0 comments

Comments

@SimonRichardson
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant