Skip to content

Rendered Help doesn't display descriptions for Argument's #33

@robertjpayne

Description

@robertjpayne

Given an example app like:

if CommandLine.arguments.count == 1 {
    CommandLine.arguments += [
        "create",
        "--help"
    ]
}

let app = Group { app in

    app.command("create",
                Argument<String>("First Name", description: "The user's first name"),
                Argument<String>("Last Name", description: "The user's last name"), { fn, ln in
                    print("fn: \(fn), ln: \(ln)")
                })

}


app.run()

The help printed is just:

Usage:

    $ ./App <First Name> <Last Name>

I think it's weird that the Argument constructor takes a description yet it never gets displayed.

I think maybe it should instead:

Usage:

    $ ./App create <First Name> <Last Name>

Arguments:
    <First Name> - The user's first name.
    <Last Name> - The user's last name.

Would you be willing to accept a PR on this?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions