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

@Fuuzetsu Fuuzetsu commented Aug 17, 2015

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

@borsboom borsboom commented Aug 18, 2015

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

@chrisdone chrisdone commented Aug 18, 2015

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

@Fuuzetsu Fuuzetsu commented Aug 19, 2015

Yes, what Chris said.

@chrisdone
Copy link
Member

@chrisdone chrisdone commented Aug 19, 2015

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

@borsboom borsboom commented Aug 23, 2015

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 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 snoyberg added the in progress label Sep 2, 2015
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 snoyberg commented Sep 2, 2015

See PR #903

@borsboom borsboom closed this in #903 Sep 2, 2015
@snoyberg snoyberg removed the in progress label Sep 2, 2015
@borsboom borsboom reopened this Sep 2, 2015
@snoyberg snoyberg removed their assignment Sep 3, 2015
@snoyberg snoyberg added the in progress label Sep 3, 2015
@borsboom borsboom modified the milestones: Options parsing, P3 Sep 12, 2015
@borsboom borsboom closed this in b265f80 Oct 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants