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

Use global --resolver option parsing for stack init #1588

Closed
harendra-kumar opened this issue Jan 2, 2016 · 3 comments
Closed

Use global --resolver option parsing for stack init #1588

harendra-kumar opened this issue Jan 2, 2016 · 3 comments

Comments

@harendra-kumar
Copy link
Collaborator

stack init implements its own --resolver command line option which seem to be doing exactly the same thing as the global --resolver option implementation.

We can avoid this duplication by deleting the parsing code in initOptsParser and passing the resolver value from globalOpts in initCmd.

See also #1531.

@mgsloan
Copy link
Contributor

mgsloan commented Jan 3, 2016

Makes sense!

@borsboom
Copy link
Contributor

borsboom commented Jan 6, 2016

stack init's --resolver is slightly different because it selects the behaviour (note the usage has ([--solver] | [--resolver RESOLVER] | [--prefer-lts] | [--prefer-nightly])), so fixing this may be a bit more involved as you'll have to ensure none of the other local options (--solver, --prefer-lts, --prefer-nightly) were given if the global --resolver is set.

@harendra-kumar
Copy link
Collaborator Author

Ah, I missed this point earlier.

The init options have changed a bit with PR #1583 though. --resolver can now be specified with --solver. So we have to take care of --prefer-lts and --prefer-nightly only, but that does not change the order of effort.

Usage: stack init ([--resolver RESOLVER] | [--prefer-lts] | [--prefer-nightly])
                  [--solver] [--force] [--ignore-subdirs] [--help]
  Initialize a stack project based on one or more cabal packages

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

3 participants