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

CLI does not want to take config parameters #617

Closed
dstechenko opened this issue Dec 18, 2016 · 2 comments
Closed

CLI does not want to take config parameters #617

dstechenko opened this issue Dec 18, 2016 · 2 comments

Comments

@dstechenko
Copy link

dstechenko commented Dec 18, 2016

Tried using CLI --config property, and it failed.

Version: 0.5.0-RC2
Integration: cli (homebrew - macOS)

typeless:master* λ scalafmt --config "style=defaultWithAlign"
Error: Option --config failed when given 'style=defaultWithAlign'. /Users/dmytro/Projects/typeless/style=defaultWithAlign (No such file or directory)
Try  for more information.
Exception in thread "main" org.scalafmt.Error$UnableToParseCliOptions$: Failed to parse CLI options
	at org.scalafmt.Error$UnableToParseCliOptions$.<clinit>(Error.scala)
	at org.scalafmt.cli.Cli$.mainWithOptions(Cli.scala:69)
	at org.scalafmt.cli.Cli$.main(Cli.scala:63)
	at org.scalafmt.cli.Cli.main(Cli.scala)
@olafurpg
Copy link
Member

Thanks for reporting! I think this should work: scalafmt --config "\"style=defaultWithAlign\""

I agree this is unintuitive. It was supposed to work like you tried but it appears scopt drops the quotes. Maybe we should have a separate flag for passing in configuration as string, something like --config-str "style=...". WDYT?

@dstechenko
Copy link
Author

@olafurpg yeah, that would be great!

olafurpg added a commit that referenced this issue Dec 19, 2016
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

2 participants