Im­prove this page Quickly fork, edit on­line, and sub­mit a pull re­quest for this page. Re­quires a signed-in GitHub ac­count. This works well for small changes. If you'd like to make larger changes you may want to con­sider using local clone. Page wiki View or edit the com­mu­nity-main­tained wiki page as­so­ci­ated with this page.

rdmd

Syn­op­sis

In a com­mand prompt:
% cat myprog.d
import std.stdio;
void main()
{
    writeln("Hello, world without explicit compilations!");
}
% rdmd myprog
Hello, world without explicit compilations!
% _
In­side a D pro­gram:
% cat myprog.d
#!/usr/bin/env rdmd
import std.stdio;
void main()
{
    writeln("Hello, world with automated script running!");
}
% ./myprog.d
Hello, world with automated script running!
% _
(Under Win­dows re­place cat with type and #!/usr/bin/env rdmd with #!rdmd, the lat­ter as­sum­ing that rdmd can be found in your path.)

De­scrip­tion

rdmd is a com­pan­ion to the dmd com­piler that sim­pli­fies the typ­i­cal edit-com­pile-link-run or edit-make-run cycle to a rapid edit-run cycle. Like make and other tools, rdmd uses the rel­a­tive dates of the files in­volved to min­i­mize the amount of work nec­es­sary. Un­like make, rdmd tracks de­pen­den­cies and fresh­ness with­out re­quir­ing ad­di­tional in­for­ma­tion from the user.

rdmd:

Usage

rdmd [dmd and rdmd op­tions] prog­file[.d] [pro­gram ar­gu­ments]

In ad­di­tion to dmd's op­tions, rdmd rec­og­nizes the fol­low­ing:

--build-only
just build the ex­e­cutable, don't run it
--chatty
write dmd com­mands to std­out be­fore ex­e­cut­ing them
--com­piler=/path/to/com­piler
use the spec­i­fied com­piler (e.g. gdmd) in­stead of dmd
--dry-run
do not com­pile, just show what com­mands would be run (im­plies --chatty)
--eval=code
eval­u­ate code in­clud­ing it in void main(char[][] args) { ... } (mul­ti­ple --eval al­lowed, will be eval­u­ated in turn)
--ex­clude=pack­age
ex­clude a pack­age from the build (mul­ti­ple --ex­clude al­lowed)
--force
force a re­build even if ap­par­ently not nec­es­sary
--help
show a help mes­sage and exit
--loop=code
like --eval, but code will be ad­di­tion­ally in­cluded in a loop fore­ach (line; stdin.​byLine()) { ... }
--main
add an empty void main() {} func­tion (use­ful for run­ning unittests)
--makede­pend
print de­pen­den­cies in make­file for­mat and exit
--man
open web browser on man­ual page
--she­bang
rdmd is in a she­bang line (put as first ar­gu­ment)

Down­load

Au­thor

An­drei Alexan­drescu
Forums | Comments | Search | Downloads | Home