➤ ./test.d --first arg --second arg2
["--first", "arg", "--second", "arg2"]
Last active
February 1, 2021 12:15
-
-
Save PetarKirov/72168d8dc909c670444ca649ec28f80f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
src_dir="$(dirname "$0")/src" | |
# The options `-defaultlib=libphobos2.so` and `-L-fuse-ld=gold` | |
# make the compilation almost twice as fast in many situations. | |
# | |
# Explanation: | |
# * ld.gold is in general a faster linker than the default one - ld.bfd | |
# * Using the standard library Phobos as a shared library, means there a lot | |
# less work for the linker in the first place | |
dmd -mv=build_scripts="$src_dir" \ | |
-defaultlib=libphobos2.so -L-fuse-ld=gold \ | |
-i -run "$1" "${@:2}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S sh -c '$(dirname $0)/dmd.sh $0 $@' | |
// `/usr/bin/env -S` is supported by coreutils 8.30 or newer: | |
// https://lists.gnu.org/archive/html/coreutils-announce/2018-07/msg00000.html | |
void main(string[] args) | |
{ | |
import std.stdio : writeln; | |
args[1 .. $].writeln; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment