Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 1a074b0

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Avoid using + for options
Use -- or - for long/short options instead. Belonging to [master]: - OpenModelica/OpenModelica#66 - #2012
1 parent d8b46d0 commit 1a074b0

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

Compiler/BackEnd/Initialization.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ algorithm
13911391
end if;
13921392
//print("index-" + intString(index) + " ende\n");
13931393
end for;
1394-
Error.addCompilerError("The given system is mixed-determined. [index > " + intString(maxMixedDeterminedIndex) + "]\nPlease checkout the option \"+maxMixedDeterminedIndex\".");
1394+
Error.addMessage(Error.MIXED_DETERMINED, {intString(maxMixedDeterminedIndex)});
13951395
fail();
13961396
end fixInitialSystem;
13971397

Compiler/FrontEnd/ModelicaBuiltin.mo

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,15 +1510,15 @@ function setPreOptModules "example input: removeFinalParameters,removeSimpleEqua
15101510
input String modules;
15111511
output Boolean success;
15121512
algorithm
1513-
success := setCommandLineOptions("+preOptModules=" + modules);
1513+
success := setCommandLineOptions("--preOptModules=" + modules);
15141514
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
15151515
end setPreOptModules;
15161516

15171517
function setCheapMatchingAlgorithm "example input: 3"
15181518
input Integer matchingAlgorithm;
15191519
output Boolean success;
15201520
algorithm
1521-
success := setCommandLineOptions("+cheapmatchingAlgorithm=" + String(matchingAlgorithm));
1521+
success := setCommandLineOptions("--cheapmatchingAlgorithm=" + String(matchingAlgorithm));
15221522
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
15231523
end setCheapMatchingAlgorithm;
15241524

@@ -1537,7 +1537,7 @@ function setMatchingAlgorithm "example input: omc"
15371537
input String matchingAlgorithm;
15381538
output Boolean success;
15391539
algorithm
1540-
success := setCommandLineOptions("+matchingAlgorithm=" + matchingAlgorithm);
1540+
success := setCommandLineOptions("--matchingAlgorithm=" + matchingAlgorithm);
15411541
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
15421542
end setMatchingAlgorithm;
15431543

@@ -1556,15 +1556,15 @@ function setIndexReductionMethod "example input: dynamicStateSelection"
15561556
input String method;
15571557
output Boolean success;
15581558
algorithm
1559-
success := setCommandLineOptions("+indexReductionMethod=" + method);
1559+
success := setCommandLineOptions("--indexReductionMethod=" + method);
15601560
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
15611561
end setIndexReductionMethod;
15621562

15631563
function setPostOptModules "example input: lateInline,inlineArrayEqn,removeSimpleEquations."
15641564
input String modules;
15651565
output Boolean success;
15661566
algorithm
1567-
success := setCommandLineOptions("+postOptModules=" + modules);
1567+
success := setCommandLineOptions("--postOptModules=" + modules);
15681568
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
15691569
end setPostOptModules;
15701570

@@ -1583,7 +1583,7 @@ function setTearingMethod "example input: omcTearing"
15831583
input String tearingMethod;
15841584
output Boolean success;
15851585
algorithm
1586-
success := setCommandLineOptions("+tearingMethod=" + tearingMethod);
1586+
success := setCommandLineOptions("--tearingMethod=" + tearingMethod);
15871587
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
15881588
end setTearingMethod;
15891589

@@ -1866,7 +1866,7 @@ function setAnnotationVersion "Sets the annotation version."
18661866
input String annotationVersion;
18671867
output Boolean success;
18681868
algorithm
1869-
success := setCommandLineOptions("+annotationVersion=" + annotationVersion);
1869+
success := setCommandLineOptions("--annotationVersion=" + annotationVersion);
18701870
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
18711871
end setAnnotationVersion;
18721872

@@ -1893,7 +1893,7 @@ function setVectorizationLimit
18931893
input Integer vectorizationLimit;
18941894
output Boolean success;
18951895
algorithm
1896-
success := setCommandLineOptions("+v=" + String(vectorizationLimit));
1896+
success := setCommandLineOptions("-v=" + String(vectorizationLimit));
18971897
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
18981898
end setVectorizationLimit;
18991899

@@ -1909,7 +1909,7 @@ public function setDefaultOpenCLDevice
19091909
input Integer defdevid;
19101910
output Boolean success;
19111911
algorithm
1912-
success := setCommandLineOptions("+o=" + String(defdevid));
1912+
success := setCommandLineOptions("-o=" + String(defdevid));
19131913
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
19141914
end setDefaultOpenCLDevice;
19151915

@@ -1930,7 +1930,7 @@ function setOrderConnections "Sets the orderConnection flag."
19301930
input Boolean orderConnections;
19311931
output Boolean success;
19321932
algorithm
1933-
success := setCommandLineOptions("+orderConnections=" + String(orderConnections));
1933+
success := setCommandLineOptions("--orderConnections=" + String(orderConnections));
19341934
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
19351935
end setOrderConnections;
19361936

@@ -1944,7 +1944,7 @@ function setLanguageStandard "Sets the Modelica Language Standard."
19441944
input String inVersion;
19451945
output Boolean success;
19461946
algorithm
1947-
success := setCommandLineOptions("+std=" + inVersion);
1947+
success := setCommandLineOptions("--std=" + inVersion);
19481948
annotation(__OpenModelica_EarlyInline = true, preferredView="text");
19491949
end setLanguageStandard;
19501950

Compiler/Template/CodegenFMUCpp.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ case SIMCODE(modelInfo=MODELINFO(__), makefileParams=MAKEFILE_PARAMS(__), simula
738738
# OMCompiler/SimulationRuntime/cpp/Makefile
739739
# - rebuild omc to add the new platform
740740
# - invoke the omc commands
741-
# setCommandLineOptions("+simCodeTarget=Cpp");
741+
# setCommandLineOptions("--simCodeTarget=Cpp");
742742
# buildModelFMU(MyModel, platforms={"i686-w64-mingw32"});
743743
# - alternatively call this Makefile with
744744
# make TARGET_TRIPLET=i686-w64-mingw32 -f <%fileNamePrefix%>_FMU.makefile

Compiler/Util/Error.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,8 @@ public constant Message VAR_NO_REMAINING_EQN = MESSAGE(582, SYMBOLIC(), WARNING(
911911
Util.gettext("Variable %s does not have any remaining equation to be solved in.\n The original equations were:%s"));
912912
public constant Message MOVING_PARAMETER_BINDING_TO_INITIAL_EQ_SECTION = MESSAGE(582, TRANSLATION(), NOTIFICATION(),
913913
Util.gettext("Moving binding to initial equation section and setting fixed attribute of %s to false."));
914+
public constant Message MIXED_DETERMINED = MESSAGE(583, SYMBOLIC(), ERROR(),
915+
Util.gettext("The given system is mixed-determined. [index > %s]\nPlease checkout the option \"--maxMixedDeterminedIndex\"."));
914916

915917
public constant Message MATCH_SHADOWING = MESSAGE(5001, TRANSLATION(), ERROR(),
916918
Util.gettext("Local variable '%s' shadows another variable."));

0 commit comments

Comments
 (0)