Skip to content

Replace custom CLI parser with System.CommandLine 2.0.8#590

Merged
Hirogen merged 2 commits into
Developmentfrom
188-command-line-arguments
May 28, 2026
Merged

Replace custom CLI parser with System.CommandLine 2.0.8#590
Hirogen merged 2 commits into
Developmentfrom
188-command-line-arguments

Conversation

@Hirogen
Copy link
Copy Markdown
Collaborator

@Hirogen Hirogen commented May 28, 2026

The hand-rolled CmdLine parser under Classes/CommandLine/ (~460 LOC) has a //TODO from years ago suggesting replacement. Swap it for System.CommandLine 2.0.8 (stable since 2026-05-12).

Surface preserved:

  • --config / -c (new canonical forms)
  • -config accepted as a hidden alias for back-compat with existing shortcuts/scripts
  • Positional args still accept log files and session files (.lxj)

Also fixes a latent bug: the original code checked configFile.Exists before cmdLine.Parse(args) was called, so the config-file-import block was effectively dead. The System.CommandLine port parses first, so -config FILE actually imports now.

Also fixes an edge case in FileOperationService.AddMultiFileTab where .lxj session files passed alongside log files in MultiFile mode were treated as raw log lines. Sessions are now split out and dispatched to the session loader before the multi-file tab is created.

The hand-rolled CmdLine parser under Classes/CommandLine/ (~460 LOC)
has a //TODO from years ago suggesting replacement. Swap it for
System.CommandLine 2.0.8 (stable since 2026-05-12).

Surface preserved:
- --config <file> / -c <file> (new canonical forms)
- -config <file> accepted as a hidden alias for back-compat with
  existing shortcuts/scripts
- Positional args still accept log files and session files (.lxj)

Also fixes a latent bug: the original code checked configFile.Exists
before cmdLine.Parse(args) was called, so the config-file-import
block was effectively dead. The System.CommandLine port parses first,
so -config FILE actually imports now.

Also fixes an edge case in FileOperationService.AddMultiFileTab where
.lxj session files passed alongside log files in MultiFile mode were
treated as raw log lines. Sessions are now split out and dispatched
to the session loader before the multi-file tab is created.
@Hirogen Hirogen linked an issue May 28, 2026 that may be closed by this pull request
@Hirogen Hirogen merged commit 7347827 into Development May 28, 2026
1 check passed
@Hirogen Hirogen deleted the 188-command-line-arguments branch May 28, 2026 19:37
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.

Command line arguments

1 participant