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

stack exec --help is invalid #806

Closed
Fuuzetsu opened this issue Aug 17, 2015 · 7 comments
Closed

stack exec --help is invalid #806

Fuuzetsu opened this issue Aug 17, 2015 · 7 comments

Comments

@Fuuzetsu
Copy link
Contributor

Invalid option `--help'

Usage: stack exec CMD [-- ARGS (e.g. stack ghc -- X.hs -o x)] ([--plain] |
                  ([--ghc-package-path] | [--no-ghc-package-path])
                  ([--stack-exe] | [--no-stack-exe]) [--package ARG])
  Execute a command
@borsboom
Copy link
Contributor

Would you mind being more specific about what is incorrect? I do see the (e.g. stack ghc -- X.hs -o x) is more relevant for another command, is there anything else?

@chrisdone
Copy link
Member

I think he means the fact that --help says "invalid option --help". I don't know why optparse-applicative does this.

@Fuuzetsu
Copy link
Contributor Author

Yes, what Chris said.

@chrisdone
Copy link
Member

I found while writing stack new that I can add a --help option manually, as here, but it seems like this shouldn't be necessary. We could, at least, add this to addCommand automatically. Although it feels like optparse should probably have some non-manual way of enabling this.

@borsboom borsboom added this to the Options parsing milestone Aug 23, 2015
@borsboom
Copy link
Contributor

That's very strange, other subcommands seem to have working --help without adding it manually. And optparse-simple's addCommand use a parser which adds a --help option just like the one you add manually for stack new. Probably chalk this down to another bizarre argument-order/subcommand-related behaviour in optparse-applicative.

@snoyberg snoyberg self-assigned this Sep 2, 2015
@snoyberg
Copy link
Contributor

snoyberg commented Sep 2, 2015

This is definitely buggy behavior, I was bitten by this a bit ago and got curious. I'm preparing a PR with an ugly hack that solves it, though the usability downside makes me nervous about just committing to master.

snoyberg added a commit that referenced this issue Sep 2, 2015
fixes #806)

Downside: usage information now looks like:

Usage: stack exec [CMD -- ARGS (e.g. stack ghc -- X.hs -o x)]

Notice how "CMD" is inside the square brackets. Still seems like a
worthwhile tradeoff to me.
snoyberg added a commit that referenced this issue Sep 2, 2015
fixes #806)

Downside: usage information now looks like:

Usage: stack exec [CMD -- ARGS (e.g. stack ghc -- X.hs -o x)]

Notice how "CMD" is inside the square brackets. Still seems like a
worthwhile tradeoff to me.
@snoyberg
Copy link
Contributor

snoyberg commented Sep 2, 2015

See PR #903

@borsboom borsboom reopened this Sep 2, 2015
@snoyberg snoyberg removed their assignment Sep 3, 2015
@borsboom borsboom modified the milestones: Options parsing, P3 Sep 12, 2015
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

4 participants