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

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

Closed
robertjpayne opened this issue Oct 19, 2016 · 2 comments
Closed

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

robertjpayne opened this issue Oct 19, 2016 · 2 comments

Comments

@robertjpayne
Copy link

robertjpayne commented Oct 19, 2016

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?

@robertjpayne
Copy link
Author

Alternatively I'd use an Option but you can't specify an Option that has no default value and is 'required'.

@kylef
Copy link
Owner

kylef commented Oct 19, 2016

Yes, we should start printing the argument descriptions. This is something I never got round to doing.

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

No branches or pull requests

2 participants