@@ -158,6 +158,9 @@ Usage:
158158 -unittest compile in unit tests
159159 -v verbose
160160 -vdmd print commands run by this script
161+ -verrors=<num> limit the number of error messages (0 means unlimited)
162+ -verrors=context (enabled by default) show diagnostic messages with context
163+ -verrors=spec show errors from speculative compiles such as __traits(compiles,...)
161164 --version print compiler version and exit
162165 -version=level compile in version code >= level
163166 -version=ident compile in version code identified by ident
@@ -442,6 +445,18 @@ while ( $arg_i < scalar(@ARGV) ) {
442445 }
443446 } elsif ( $arg =~ m / ^-v1$ / ) {
444447 push @out , ' -fd-version=1' ;
448+ } elsif ( $arg =~ m / ^-verrors$ / ) {
449+ errorExit " switch -verrors expects a value" ;
450+ } elsif ( $arg =~ m / ^-verrors=(\d *)$ / ) {
451+ push @out , " -fmax-errors=" . ( $1 || 0 );
452+ } elsif ( $arg =~ m / ^-verrors=(.+)$ / ) {
453+ if ( $1 eq " context" ) {
454+ # ignored
455+ } elsif ( $1 eq " spec" ) {
456+ push @out , ' -Wspeculative' ;
457+ } else {
458+ errorExit " unrecongnized value passed to -verrors '$1 '" ;
459+ }
445460 } elsif ( $arg =~ m / ^--version$ / ) {
446461 $print_version = 1;
447462 } elsif ( $arg =~ m / ^-version=(.*)$ / ) {
0 commit comments