Skip to content

Make documentation an adaptor rather than implicit. #106

@SimonRichardson

Description

@SimonRichardson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions