Skip to content

Commit 59fe6a9

Browse files
devin-ai-integration[bot]Thuong Huynh
andcommitted
fix: address review bugs in devin CLI argument handling
- Add -- separator before prompt in print-mode dispatch to prevent flag-like prompts (e.g. '--version') from being parsed as backend flags - Set HEADLESS=true when MODE=print after parse_args, so build_cmd() handles it once instead of duplicating --headless in the dispatch - Declare 'line' as local in builtin_repl for scope hygiene Co-Authored-By: Thuong Huynh <admin@huynhthuong.online>
1 parent 87c429e commit 59fe6a9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

devin

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ parse_args() {
111111

112112
parse_args "$@"
113113

114+
# Print mode implies headless
115+
[ "$MODE" = "print" ] && HEADLESS=true
116+
114117
# ── Resolve backend binary ───────────────────────────────────────────────────
115118

116119
resolve_backend() {
@@ -152,6 +155,7 @@ build_cmd() {
152155

153156
builtin_repl() {
154157
local initial_prompt="$1"
158+
local line
155159

156160
printf '%s %s — interactive REPL\n' "$PROGRAM_NAME" "$VERSION"
157161
printf 'Type /help for commands, Ctrl-D to exit.\n'
@@ -225,6 +229,6 @@ case "$MODE" in
225229
;;
226230
print)
227231
# Single-turn: capture output, print to stdout, exit
228-
exec "${CMD[@]}" --headless "$PROMPT"
232+
exec "${CMD[@]}" -- "$PROMPT"
229233
;;
230234
esac

0 commit comments

Comments
 (0)