Skip to content

Commit

Permalink
ignore druntime arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Oct 10, 2017
1 parent 714e6bc commit 679ce2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/vibe/core/args.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"];

Expand Down
1 change: 1 addition & 0 deletions tests/args/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 679ce2e

Please sign in to comment.