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() {
1292
1292
}
1293
1293
1294
1294
Optional <ArgumentEntry > lastImageName = getHostedOptionArgument (imageBuilderArgs , oHName );
1295
+ if (!lastImageName .isEmpty ()) {
1296
+ validateImageName (lastImageName .get ().value ());
1297
+ }
1295
1298
1296
1299
if (!jarOptionMode ) {
1297
1300
mainClassModule = getHostedOptionArgumentValue (imageBuilderArgs , oHModule );
@@ -1333,7 +1336,7 @@ private int completeImageBuild() {
1333
1336
boolean extraNameIsLast = lastImageName .isEmpty () || lastImageName .get ().index < extraImageName .index ;
1334
1337
if (extraNameIsLast ) {
1335
1338
/* 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 ) );
1337
1340
}
1338
1341
}
1339
1342
} else { /* jarOptionMode */
@@ -1455,6 +1458,13 @@ private int completeImageBuild() {
1455
1458
}
1456
1459
}
1457
1460
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
+
1458
1468
private static void updateArgumentEntryValue (List <String > argList , ArgumentEntry listEntry , String newValue ) {
1459
1469
APIOptionHandler .BuilderArgumentParts argParts = APIOptionHandler .BuilderArgumentParts .from (argList .get (listEntry .index ));
1460
1470
argParts .optionValue = newValue ;
You can’t perform that action at this time.
0 commit comments