From 37583090f47707e7bf30a61d83c24535d910293a Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Wed, 3 May 2017 08:01:48 +0000 Subject: [PATCH] omit warning flags from echo --- sh/compile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sh/compile b/sh/compile index 5e0d263..469973b 100755 --- a/sh/compile +++ b/sh/compile @@ -113,18 +113,22 @@ compile() { # by generating a file that #includes each given file. # move -l flags to the end because gcc won't respect them otherwise + # split warning flags so they don't spam the console local final_flags=() local libraries=() + local warnings=() for flag in $our_flags $flags; do if [[ $flag == -l* ]]; then libraries+=($flag) + elif [[ $flag == -W* ]]; then + warnings+=($flag) else final_flags+=($flag) fi done - echo $compiler $std ${final_flags[@]} $file ${libraries[@]} -o $out - $compiler $std ${final_flags[@]} $file ${libraries[@]} -o $out >&2 + echo $compiler $std ${final_flags[@]} $file ${libraries[@]} -o $out >&2 + $compiler $std ${final_flags[@]} $file ${libraries[@]} ${warnings[@]} -o $out >&2 } compile "$@"