File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1292,6 +1292,9 @@ private int completeImageBuild() {
12921292 }
12931293
12941294 Optional <ArgumentEntry > lastImageName = getHostedOptionArgument (imageBuilderArgs , oHName );
1295+ if (!lastImageName .isEmpty ()) {
1296+ validateImageName (lastImageName .get ().value ());
1297+ }
12951298
12961299 if (!jarOptionMode ) {
12971300 mainClassModule = getHostedOptionArgumentValue (imageBuilderArgs , oHModule );
@@ -1333,7 +1336,7 @@ private int completeImageBuild() {
13331336 boolean extraNameIsLast = lastImageName .isEmpty () || lastImageName .get ().index < extraImageName .index ;
13341337 if (extraNameIsLast ) {
13351338 /* extraImageArg that comes after lastImageName wins */
1336- imageBuilderArgs .add (oH (SubstrateOptions .Name , "explicit image name" ) + extraImageName .value );
1339+ imageBuilderArgs .add (oH (SubstrateOptions .Name , "explicit image name" ) + validateImageName ( extraImageName .value ) );
13371340 }
13381341 }
13391342 } else { /* jarOptionMode */
@@ -1455,6 +1458,13 @@ private int completeImageBuild() {
14551458 }
14561459 }
14571460
1461+ private static String validateImageName (String imageName ) {
1462+ if (imageName .startsWith ("-" )) {
1463+ LogUtils .warning ("Image name ('" + imageName + "') start with a dash. Is another option wrongly interpreted as image name? (see --help)" );
1464+ }
1465+ return imageName ;
1466+ }
1467+
14581468 private static void updateArgumentEntryValue (List <String > argList , ArgumentEntry listEntry , String newValue ) {
14591469 APIOptionHandler .BuilderArgumentParts argParts = APIOptionHandler .BuilderArgumentParts .from (argList .get (listEntry .index ));
14601470 argParts .optionValue = newValue ;
You can’t perform that action at this time.
0 commit comments