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

-h, -H, and --help are all hardcoded to built-in help #3

Open
denizdogan opened this issue Feb 10, 2023 · 0 comments
Open

-h, -H, and --help are all hardcoded to built-in help #3

denizdogan opened this issue Feb 10, 2023 · 0 comments

Comments

@denizdogan
Copy link

It seems that it is impossible to use -h, -H or --help as they are hardcoded to throw HelpError in the parse step.

Would you be open for a PR? I would like it if this were possible:

// default: no help flags
new Command()
  .optional(c.string, ...whatever)

// -?/--help
new Command()
  .help("?", "help")
  .optional(c.string, "host", {
    flags: ["h", "host"],
    description: "omg so nice to be able to use -h again",
  })

// -h/--help
// help flag wins all conflicts
new Command()
  .help("h", "help")
  .optional(c.string, "host", {
    flags: ["h", "host"],
    description: "this will not be usable, help takes precedence",
  })

And also, I definitely think flags should be case-sensitive, so that e.g. -X is not silently transformed into -x – huge surprise when I noticed that. What do you think?

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

No branches or pull requests

1 participant