Add ddoc fullText to the CLI switches#7703
Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
| will not get called.) | ||
| $(LI `ModuleInfo` is not generated.) | ||
| $(LI $(LINK2 $(ROOT_DIR)phobos/object.html#.TypeInfo, `TypeInfo`) | ||
| instances will not be generated for structs.) |
There was a problem hiding this comment.
I'm not so sure that the CLI pages are the best place to document this. Imho we should just link to https://dlang.org/spec/betterc.html and improve this page if needed.
There was a problem hiding this comment.
I agree, but let's leave that to another PR.
| ), | ||
| Option("c", | ||
| "do not link" | ||
| "compile only, do not link" |
There was a problem hiding this comment.
That's the text from dlang.org - imho a bit more descriptive.
| "generate documentation" | ||
| "generate documentation", | ||
| `$(P Generate $(LINK2 $(ROOT_DIR)spec/ddoc.html, documentation) from source.) | ||
| $(P Note: mind the $(LINK2 $(ROOT_DIR)spec/ddoc.html#security, security considerations).) |
There was a problem hiding this comment.
I don't think that the paragraphs are needed here, but it's a 1:1 from dlang.org
src/dmd/cli.d
Outdated
| Option("inline", | ||
| "do function inlining" | ||
| "do function inlining", | ||
| `inline expand functions at the discretion of the compiler. |
There was a problem hiding this comment.
The "inline expand" looks out of place. I would just say "Inline functions"
There was a problem hiding this comment.
I agree. Sorry, I didn't comment about that earlier. Care to make the change to "Inline functions..." before we merge?
src/dmd/cli.d
Outdated
| string ddocText; /// Detailed description of the flag (in Ddoc) | ||
|
|
||
| /// | ||
| this(string flag, string helpText, TargetOS os = TargetOS.all) |
There was a problem hiding this comment.
Ideally all these parameters should be documented.
|
I'm a little skeptical about this documentation being in the binary unless it actually serves some purpose for users of the compiler. At the moment I think this is only used as a datastore to keep all related information about the compiler flags in one place. That's perfectly fine, but I think we should version it out (may actually need string mixins) so it is only used for generating the documentation, but doesn't end up in the published binary. |
It's needed for dlang/dlang.org#2068
That's why the CLI text is generated at CTFE, so these strings shouldn't end up in the binary. |
Please file a bugzilla for this. But it still needs to be versioned out so it doesn't appear in the dmd binary, because updating the dmd that builds dmd may be a looong wait. |
|
|
So as this is now using |
LGTM I don't see the output in DAutoTest. Please advise. |
Yes, this PR is a dependency of dlang/dlang.org#2068 |
src/dmd/cli.d
Outdated
| { | ||
| string ddocText; /// Detailed description of the flag (in Ddoc) | ||
|
|
||
| this(string flag, string helpText, TargetOS os = TargetOS.all) |
There was a problem hiding this comment.
Maybe pull this method out of the version blocks since it appears to be the same in both cases?
src/dmd/cli.d
Outdated
| this.os = os; | ||
| } | ||
|
|
||
| this(string flag, string helpText, string ddocText, TargetOS os = TargetOS.all) |
There was a problem hiding this comment.
Maybe
version(DdocOptions) this.ddocText = ddocText;
Then remove the other instance of this constructor?
|
@wilzbach This has been open for a week, which I think is ample time for others to weigh in. I'll probably merge this if you address @marler8997's comments above and no other objections arise. |
|
Cool! I will do so once I am back and have access to my laptop. |
67976f9 to
004438c
Compare
|
(Rebased, addressed the review and resolved the merge conflict.) |
Required for automatically generating the CLI options at dlang.org, see dlang/dlang.org#2068
There were the following differences:
-gc(only on dlang.org - the flag has been removed)profile(not mentioned on dlang.org)-run(not mentioned at the DMD output)--version(not mentioned on dlang.org)The DMD CLI wasn't alphabetical ordered for a few cases (https://dlang.org/dmd.html is).
(in the transition from the manual CLI output to the dynamically generated one, I kept the ordering to allow easy diffing of the output).
Generating the language transitions automatically depends on #7648
Anyways, the available language transitions aren't shown on dlang.org at the moment.