diff --git a/rdmd.dd b/rdmd.dd index ad13bfb621..07a4964d1c 100644 --- a/rdmd.dd +++ b/rdmd.dd @@ -5,33 +5,38 @@ $(D_S rdmd, $(H2 Synopsis) In a command prompt: -
-% cat myprog.d
+
+$(CONSOLE > cat myprog.d)
+---
 import std.stdio;
 void main()
 {
     writeln("Hello, world without explicit compilations!");
 }
-% rdmd myprog
+---
+$(CONSOLE
+> rdmd myprog
 Hello, world without explicit compilations!
-% _
-
+) Inside a D program: -
-% cat myprog.d
+
+$(CONSOLE > cat myprog.d)
+---
 #!/usr/bin/env rdmd
 import std.stdio;
 void main()
 {
     writeln("Hello, world with automated script running!");
 }
-% ./myprog.d
+---
+
+$(CONSOLE
+> ./myprog.d
 Hello, world with automated script running!
-% _
-
+) -(Under Windows replace $(B cat) with $(B type) and $(B +$(MESSAGE_BOX gray, $(B Windows): replace $(B cat) with $(B type) and $(B #!/usr/bin/env rdmd) with $(B #!rdmd), the latter assuming that $(B rdmd) can be found in your path.) @@ -68,8 +73,8 @@ source file does not produce the executable again.) $(H2 Usage) -$(P - $(B rdmd) [$(I dmd and rdmd options)] $(I progfile)[.d] [$(I program arguments)] +$(CONSOLE +$(B rdmd) [$(I dmd and rdmd options)] $(I progfile)[.d] [$(I program arguments)] ) $(P In addition to $(LINK2 $(ROOT_DIR)dmd.html, `dmd`)'s options, $(B rdmd) recognizes the following: @@ -88,8 +93,11 @@ compiler (e.g. gdmd) instead of dmd) $(DT $(B --dry-run)) $(DD do not compile, just show what commands would be run (implies --chatty)) -$(DT $(B --eval)=code) $(DD evaluate code including it in $(D_PARAM -void main(char[][] args) { ... }) (multiple --eval allowed, will be +$(DT $(B --eval)=code) $(DD evaluate code including it in +--- +void main(char[][] args) { ... } +--- +(multiple --eval allowed, will be evaluated in turn)) $(DT $(B --exclude)=package) $(DD exclude a package from the build (multiple --exclude allowed)) @@ -104,9 +112,16 @@ necessary) $(DT $(B --help)) $(DD show a help message and exit) $(DT $(B --loop)=code) $(DD like --eval, but code will be additionally -included in a loop $(D_PARAM foreach (line; stdin.byLine()) { ... })) +included in a loop +--- +foreach (line; stdin.byLine()) { ... } +--- +) -$(DT $(B --main)) $(DD add an empty $(D_PARAM void main() {}) function +$(DT $(B --main)) $(DD add an empty +--- +void main() {} +--- (useful for running unittests)) $(DT $(B --makedepend)) $(DD print dependencies in makefile format and exit)