Skip to content

Differences from urfave/cli/v2 to v3: DefaultText, cli.StringSlice and quotes #11

@enrichman

Description

@enrichman

While migrating from urfave/cli/v2 to v3 I have found few differences in the generated docs.

DefaultText

I have a cli.StringFlag with a DefaultText (default text of the flag for usage purposes):

&cli.StringFlag{
	Name:        "kubeconfig",
	Usage:       "kubeconfig path",
	Destination: &appCtx.Kubeconfig,
	DefaultText: "$HOME/.kube/config or $KUBECONFIG if set",
}

Is it expected?

Image

cli.StringSlice

Moving from the cli.StringSlice to the []string is adding the empty slice as default:

// v2
**--agent-args**="": agents extra arguments

// v3
**--agent-args**="": agents extra arguments (default: [])

quotes

Quotes for the default strings are missing:

// v2
**--mode**="": k3k mode type (shared, virtual) (default: "shared")

// v3
**--mode**="": k3k mode type (shared, virtual) (default: shared)

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