diff --git a/core/vibe/core/args.d b/core/vibe/core/args.d index 0c648b1c21..2ad3e7fa53 100644 --- a/core/vibe/core/args.d +++ b/core/vibe/core/args.d @@ -16,7 +16,7 @@ module vibe.core.args; import vibe.core.log; import vibe.data.json; -import std.algorithm : any, map, sort; +import std.algorithm : any, filter, map, sort, startsWith; import std.array : array, join, replicate, split; import std.exception; import std.file; @@ -222,7 +222,7 @@ private void init() import vibe.utils.string : stripUTF8Bom; version (VibeDisableCommandLineParsing) {} - else g_args = Runtime.args; + else g_args = Runtime.args.filter!(arg => !arg.startsWith("--DRT-")).array; if (!g_args.length) g_args = ["dummy"]; diff --git a/tests/args/test.sh b/tests/args/test.sh index b5c894484c..e4643923df 100755 --- a/tests/args/test.sh +++ b/tests/args/test.sh @@ -11,6 +11,7 @@ fi ( $VIBE | grep -q '^argtest=$' ) || die "Fail (no argument)" ( $VIBE -- --argtest=aoeu | grep -q '^argtest=aoeu$' ) || die "Fail (with argument)" +( $VIBE -- --argtest=aoeu --DRT-gcopt=profile:1 | grep -q '^argtest=aoeu$' ) || die "Fail (with argument)" ( ( ! $VIBE -- --inexisting 2>&1 ) | grep -qF 'Unrecognized command line option' ) || die "Fail (unknown argument)" echo 'OK'