Skip to content

Commit

Permalink
- Avoid printing multiple copies of the usage if +help is given on th…
Browse files Browse the repository at this point in the history
…e command-line

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12430 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Aug 6, 2012
1 parent 206157a commit 8497866
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Compiler/Main/Main.mo
Expand Up @@ -1131,7 +1131,7 @@ algorithm
case {}
equation
false = System.userIsRoot();
Flags.printUsage();
Debug.bcall0(not Config.helpRequest() /* Already printed help */, Flags.printUsage);
then ();

case _
Expand Down
7 changes: 4 additions & 3 deletions Compiler/Translation/de.po
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenModelica trunk\n"
"Report-Msgid-Bugs-To: openmodelica@ida.liu.se\n"
"POT-Creation-Date: 2012-08-06 09:26+0200\n"
"POT-Creation-Date: 2012-08-06 11:04+0200\n"
"PO-Revision-Date: 2012-08-03 14:38+0200\n"
"Last-Translator: <martin.sjolund@liu.se>\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -2193,13 +2193,14 @@ msgstr ""

#: ../Util/Flags.mo:678
msgid ""
"Defines whether plot commands should open OMPlot or just output results."
"Defines whether plot commands should open OMPlot or show the list of "
"arguments that would have been sent to OMPlot."
msgstr ""

#: ../Util/Flags.mo:681
msgid "Override the locale from the environment."
msgstr ""

#: ../Main/Main.mo:1116
#: ../Main/Main.mo:1124
msgid "You are trying to run OpenModelica as root.\n"
msgstr ""
7 changes: 4 additions & 3 deletions Compiler/Translation/openmodelica.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenModelica trunk\n"
"Report-Msgid-Bugs-To: openmodelica@ida.liu.se\n"
"POT-Creation-Date: 2012-08-06 09:26+0200\n"
"POT-Creation-Date: 2012-08-06 11:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -2193,13 +2193,14 @@ msgstr ""

#: ../Util/Flags.mo:678
msgid ""
"Defines whether plot commands should open OMPlot or just output results."
"Defines whether plot commands should open OMPlot or show the list of "
"arguments that would have been sent to OMPlot."
msgstr ""

#: ../Util/Flags.mo:681
msgid "Override the locale from the environment."
msgstr ""

#: ../Main/Main.mo:1116
#: ../Main/Main.mo:1124
msgid "You are trying to run OpenModelica as root.\n"
msgstr ""
30 changes: 15 additions & 15 deletions Compiler/Translation/sv.po
Expand Up @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenModelica trunk\n"
"Report-Msgid-Bugs-To: openmodelica@ida.liu.se\n"
"POT-Creation-Date: 2012-08-06 09:26+0200\n"
"PO-Revision-Date: 2012-08-06 09:56+0100\n"
"POT-Creation-Date: 2012-08-06 11:04+0200\n"
"PO-Revision-Date: 2012-08-06 11:11+0100\n"
"Last-Translator: Martin Sjölund <martin.sjolund@liu.se>\n"
"Language-Team: Swedish\n"
"Language: sv\n"
Expand Down Expand Up @@ -1890,15 +1890,15 @@ msgstr ""

#: ../Util/Flags.mo:595
msgid "remove parameter with evalute=true annotation"
msgstr ""
msgstr "tar bort parametrar med evaluate=true annotation"

#: ../Util/Flags.mo:596
msgid "count the mathematic operations of the system"
msgstr ""
msgstr "räknar antalen matematiska operationer i systemet"

#: ../Util/Flags.mo:598
msgid "Generates symbolic jacobian"
msgstr ""
msgstr "Skapar symbolisk Jacobian"

#: ../Util/Flags.mo:599
msgid ""
Expand All @@ -1921,19 +1921,19 @@ msgstr ""

#: ../Util/Flags.mo:608
msgid "Sets the target language for the code generation"
msgstr ""
msgstr "Anger målspråket för kodgenerering "

#: ../Util/Flags.mo:611
msgid "Orders connect equations alphabetically if set."
msgstr ""
msgstr "Anger om connect-ekvationer ska sorteras i bokstavsordning."

#: ../Util/Flags.mo:614
msgid "Prints out extra type information if set."
msgstr ""
msgstr "Skriver ut extra typ-information."

#: ../Util/Flags.mo:617
msgid "Sets whether to split arrays or not."
msgstr ""
msgstr "Anger om arrayer ska delas upp eller inte."

#: ../Util/Flags.mo:626
msgid "Turns on silent mode."
Expand All @@ -1945,7 +1945,7 @@ msgstr ""

#: ../Util/Flags.mo:632
msgid "Sets the number of processors to use."
msgstr ""
msgstr "Anger antalet processorer som ska användas."

#: ../Util/Flags.mo:635
msgid "Sets the latency for parallel execution."
Expand All @@ -1961,11 +1961,11 @@ msgstr ""

#: ../Util/Flags.mo:644
msgid "Sets the vectorization limit, arrays and matrices larger than this will not be vectorized."
msgstr ""
msgstr "Ställer in gränsen för vektorisering; arrayer och matriser större än denna kommer inte vektoriseras."

#: ../Util/Flags.mo:647
msgid "Turns on simulation code generation."
msgstr ""
msgstr "Slår på generering av simuleringskod"

#: ../Util/Flags.mo:650
msgid "Sets whether to evaluate parameters in annotations or not."
Expand All @@ -1988,14 +1988,14 @@ msgid "Sets the reduction method to be used."
msgstr ""

#: ../Util/Flags.mo:678
msgid "Defines whether plot commands should open OMPlot or just output results."
msgstr ""
msgid "Defines whether plot commands should open OMPlot or show the list of arguments that would have been sent to OMPlot."
msgstr "Anger om plot-kommandon ska öppna OMPlot eller visa argumenten som skulle skickats till OMPlot."

#: ../Util/Flags.mo:681
msgid "Override the locale from the environment."
msgstr "Överskrid de nationella inställningarna i omgivningen."

#: ../Main/Main.mo:1116
#: ../Main/Main.mo:1124
msgid "You are trying to run OpenModelica as root.\n"
msgstr "Du försöker köra OpenModelica som root.\n"

16 changes: 16 additions & 0 deletions Compiler/Util/Debug.mo
Expand Up @@ -493,6 +493,22 @@ algorithm
end match;
end bcall;

public function bcall0
"function: bcall0
bool controlled calling of function."
input Boolean inBoolean;
input Func func;
partial function Func end Func;
algorithm
_ := match (inBoolean,func)
case (true,_)
equation
func();
then ();
case (false,_) then ();
end match;
end bcall0;

public function bcall1
"function: bcall1
bool controlled calling of function."
Expand Down
3 changes: 2 additions & 1 deletion Compiler/Util/Flags.mo
Expand Up @@ -675,7 +675,7 @@ constant ConfigFlag REDUCTION_METHOD = CONFIG_FLAG(39, "reductionMethod",
Util.gettext("Sets the reduction method to be used."));
constant ConfigFlag PLOT_SILENT = CONFIG_FLAG(40, "plotSilent",
NONE(), EXTERNAL(), BOOL_FLAG(false), NONE(),
Util.gettext("Defines whether plot commands should open OMPlot or just output results."));
Util.gettext("Defines whether plot commands should open OMPlot or show the list of arguments that would have been sent to OMPlot."));
constant ConfigFlag LOCALE_FLAG = CONFIG_FLAG(41, "locale",
NONE(), EXTERNAL(), STRING_FLAG(""), NONE(),
Util.gettext("Override the locale from the environment."));
Expand Down Expand Up @@ -1023,6 +1023,7 @@ algorithm
case ("help", _, _)
equation
values = List.map(inValues, System.tolower);
System.gettextInit(Util.if_(getConfigBool(RUNNING_TESTSUITE),"C",getConfigString(LOCALE_FLAG)));
printHelp(values);
setConfigBool(HELP, true);
then
Expand Down

0 comments on commit 8497866

Please sign in to comment.