-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Accept to pass compiler options to crystal docs #3622
Accept to pass compiler options to crystal docs #3622
Conversation
opts.on("--release", "Compile in release mode") do | ||
compiler.release = true | ||
end | ||
opts.on("-s", "--stats", "Enable statistics output") do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stats for docs should be possible I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above. In usual compiler option, --stat
dose not appear if it is not code generation command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, stats for docs is possible, just you say. I'll try to add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But all no code generation command stats is not available, so this code is right.
I agree, |
@asterite yes, |
afef168
to
ff64a7b
Compare
private def setup_simple_compiler_options(compiler, opts) | ||
opts.on("-d", "--debug", "Add symbolic debug info") do | ||
compiler.debug = true | ||
private def setup_simple_compiler_options(compiler, opts, no_codegen = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flag should better be named positively: codegen = true
. This resolves the double negation from unless no_codegen
to if codegen
.
opts.on("-h", "--help", "Show this message") do | ||
puts opts | ||
exit | ||
end | ||
unless no_codegen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These flags should still be above --help
which is supposed to be the last item.
@makenowjust It seems this can now be implemented with |
As there is no issue for this, it would probably be better to leave this PR open until there is a successor. Otherwise the improvement might get lost... |
Thinking a bit more about this, I'm not sure what options would be valuable for the |
#codetriage If there's no real benefit, I'd recommend closing this PR. |
Compiler options have been added in #6668. Thanks anyway, @makenowjust 👍 |
crystal docs
dose not build a program, however it uses the compiler. So,crystal docs
should be accepted compiler options.