Skip to content

Forward unknown long-form CLI flags to Electron while preserving app argument semantics - #1009

Merged
highperformancecoder merged 5 commits into
masterfrom
copilot/minsky-command-line-flags
Sep 29, 2026
Merged

highperformancecoder merged 5 commits into
masterfrom
copilot/minsky-command-line-flags

Conversation

Copilot AI commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Minsky currently consumes process.argv itself, which caused unknown flags to be ignored by Electron/Chromium. This change routes unknown --... switches to Electron and keeps existing Minsky-specific argument behavior intact.

  • CLI parsing behavior

    • Continue handling --version internally.
    • Forward unknown long-form switches (--foo, --foo=bar) to app.commandLine.appendSwitch(...).
    • Preserve -- as an explicit end-of-options delimiter; subsequent args are treated as positional inputs.
  • Positional argument handling

    • Parse only user-supplied arguments (exclude runtime/executable entries) before startup logic.
    • Keep positional model-file loading behavior, now based on explicit positional collection.
  • Safety/compatibility constraints

    • Do not forward single-dash arguments (-x) to avoid changing meaning of short-form or platform-injected args.
if (arg.startsWith('--')) {
  const flag = arg.replace(/^-+/, '');
  const splitAt = flag.indexOf('=');
  if (splitAt >= 0)
    app.commandLine.appendSwitch(flag.slice(0, splitAt), flag.slice(splitAt + 1));
  else
    app.commandLine.appendSwitch(flag);
} else if (arg[0] !== '-') {
  App.cliArguments.push(arg);
}

This change is Reviewable

Copilot AI and others added 5 commits September 28, 2026 08:19
Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
Co-authored-by: highperformancecoder <3075825+highperformancecoder@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e660aecd-d71c-4a87-9f3b-d15df3b4f5e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@highperformancecoder
highperformancecoder marked this pull request as ready for review September 29, 2026 00:12
Copilot AI balanced review requested due to automatic review settings September 29, 2026 00:12
@highperformancecoder

Copy link
Copy Markdown
Owner

@coderabbitai review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused changes correctly implement the documented CLI semantics without unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Updates Electron startup argument parsing while preserving Minsky’s positional model loading.

Changes:

  • Handles --version internally and forwards unknown long-form switches.
  • Honors -- and ignores single-dash options.
  • Collects positional arguments without executable entries.
File Description
gui-js/​apps/​minsky-electron/​src/​app/​app.ts Refines CLI parsing and model-file selection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@highperformancecoder
highperformancecoder merged commit ab8ea62 into master Sep 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants