Skip to content

Commit c22d7b0

Browse files
Modify mmoc script parameters order.
1 parent e891886 commit c22d7b0

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

bin/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ echo "Created build directory: $BUILD_DIR"
6363

6464
# Compile the MicroModelica file
6565
echo "Compiling $MO_FILE..."
66-
if ! "$MMOC_BIN/mmoc" $FLAGS -o "$BUILD_DIR/$FILE" "$MO_FILE"; then
66+
if ! "$MMOC_BIN/mmoc" "$MO_FILE" $FLAGS -o "$BUILD_DIR/$FILE"; then
6767
echo "Error: Compilation failed."
6868
exit 1
6969
fi

bin/mmoc.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#
44
# FILE: mmoc.sh
55
#
6-
# USAGE: mmoc.sh [OPTIONS] <FILE>
6+
# USAGE: mmoc.sh <FILE> [OPTIONS]
77
#
88
# DESCRIPTION: Runs the MicroModelica compiler on file <FILE>
9-
# with options defined in <OPTIONS>
9+
# with options defined in [OPTIONS]
1010
#
1111
# PARAMETERS: <FILE> MicroModelica file.
1212
# OPTIONS: [OPTIONS] MicroModelica compiler options (see ./mmoc --help).
@@ -25,12 +25,12 @@ fi
2525

2626
# Validate input parameters
2727
if [ $# -lt 2 ]; then
28-
echo "Usage: $0 [OPTIONS] <FILE>"
28+
echo "Usage: $0 <FILE> [OPTIONS]"
2929
exit 1
3030
fi
3131

32-
OPTIONS=$1
33-
FILE=$2
32+
FILE=$1
33+
OPTIONS=$2
3434

3535
# Check if the specified file exists
3636
if [ ! -f "$FILE" ]; then

src/gui/mmomegui.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,12 +631,12 @@ bool MmomeGui::compile(bool dbg)
631631
set += flags;
632632
}
633633
set += "-o " + buildDir.absolutePath() + SLASH + Editor::instance()->activeBaseFileName();
634-
args << set;
635634
args << Editor::instance()->activeFullFileName();
635+
args << set;
636636
QString comp = _utils->appCommand(CMD_COMPILE);
637637
_compiler_msg->setPlainText(_compiler_msg->toPlainText() + QString("\nCompiling model: "));
638-
_compiler_msg->setPlainText(_compiler_msg->toPlainText() + QString("\n") + _utils->appDir(MMOC_BIN) + SLASH + comp + " " + set + " " +
639-
Editor::instance()->activeFullFileName());
638+
_compiler_msg->setPlainText(_compiler_msg->toPlainText() + QString("\n") + _utils->appDir(MMOC_BIN) + SLASH + comp + " " + Editor::instance()->activeFullFileName() + " " +
639+
set);
640640
_compiler_msg->moveCursor(QTextCursor::End);
641641
_compiler_msg->ensureCursorVisible();
642642
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();

0 commit comments

Comments
 (0)