Skip to content

Commit eb96476

Browse files
sbryngelsonAI Assistantqodo-merge-pro[bot]
authored
Homebrew formula (#1037)
Co-authored-by: AI Assistant <[email protected]> Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
1 parent 4f0704f commit eb96476

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/workflows/homebrew.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ jobs:
251251
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py "$TESTDIR/"
252252
253253
echo "Running with $(sysctl -n hw.ncpu) processors..."
254-
# Use absolute path since mfc wrapper creates its own tmpdir
255-
mfc run "$TESTDIR/case.py" -j $(sysctl -n hw.ncpu)
254+
# Use absolute path and shorthand syntax (mfc auto-detects and prepends 'run')
255+
mfc "$TESTDIR/case.py" -j $(sysctl -n hw.ncpu)
256256
257257
echo "Test case completed successfully!"
258258

packaging/homebrew/mfc.rb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ def install
102102
MFC (Homebrew) #{version}
103103
104104
Usage:
105+
mfc <case.py> [options]
105106
mfc run <case.py> [options]
106107
107108
Examples:
108-
mfc run case.py -j 1
109+
mfc case.py -n 2
110+
mfc run case.py -n 2 -t pre_process simulation
109111
110112
Notes:
111113
- This Homebrew wrapper uses prebuilt binaries and a preinstalled venv.
@@ -115,9 +117,15 @@ def install
115117
exit 0
116118
fi
117119
120+
# Smart detection: if first arg looks like a case file, auto-prepend "run"
121+
if [[ "${SUBCMD}" =~ .py$ ]] || [[ -f "${SUBCMD}" ]]; then
122+
ARGS=("run" "${ARGS[@]}")
123+
SUBCMD="run"
124+
fi
125+
118126
if [[ "${SUBCMD}" != "run" ]]; then
119127
echo "mfc (Homebrew): only 'run' is supported in the Homebrew package."
120-
echo "Use 'mfc run <case.py>' or clone the repository for developer commands."
128+
echo "Use 'mfc <case.py>' or clone the repository for developer commands."
121129
exit 2
122130
fi
123131
@@ -218,17 +226,18 @@ def caveats
218226
MFC has been installed successfully!
219227
220228
To run a case:
221-
mfc run <case.py>
229+
mfc <case.py>
230+
mfc run <case.py> (explicit form)
222231
223232
Pre-built binaries are also available directly:
224233
pre_process, simulation, post_process
225234
226235
Examples are available in:
227236
#{prefix}/examples
228237
229-
Example:
238+
Quick start:
230239
cp #{prefix}/examples/1D_sodshocktube/case.py .
231-
mfc run case.py
240+
mfc case.py -n 2
232241
233242
Note: Cantera 3.1.0 is pre-installed in the MFC virtual environment.
234243
EOS

0 commit comments

Comments
 (0)