Skip to content

Enforce usage as per Use string #4

Open
@ammario

Description

@ammario

E.g., in coder/coder we have code like:

	cmd := &serpent.Cmd{
		Use:   "create [name]",
		Short: "DEPRECATED: Create a template from the current directory or as specified by flag",
		Middleware: serpent.Chain(
			serpent.RequireRangeArgs(0, 1),
			r.InitClient(client),
		),

where the serpent.RequireRangeArgs(0, 1) is arguably redundant with the Use. Also, we could provide an error message by just parsing Use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions