summaryrefslogtreecommitdiff
path: root/src/Agent.App/Cli
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-11 21:44:53 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-11 21:44:53 +0900
commit6c3458a5ec37a5b69957ad17c84de58984698f25 (patch)
treebe5c5716e7488fcf1bc1a58de0ded0b9238f34cb /src/Agent.App/Cli
parentb5ccecca01007f2a2459265df6d749fbfd31aa84 (diff)
Audit and align v1 runtime design
Diffstat (limited to 'src/Agent.App/Cli')
-rw-r--r--src/Agent.App/Cli/CommandLine.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Agent.App/Cli/CommandLine.cs b/src/Agent.App/Cli/CommandLine.cs
index df65080..3fdac9f 100644
--- a/src/Agent.App/Cli/CommandLine.cs
+++ b/src/Agent.App/Cli/CommandLine.cs
@@ -6,8 +6,8 @@ public sealed record CommandLine(AppCommand Command, string? ConfigPath, string?
{
public static CommandLine Parse(string[] args)
{
- if (args.Length == 0) throw new CommandLineException("Expected 'serve' or 'check'.");
- AppCommand command = args[0] switch
+ bool implicitServe = args.Length == 0 || args[0].StartsWith("--", StringComparison.Ordinal);
+ AppCommand command = implicitServe ? AppCommand.Serve : args[0] switch
{
"serve" => AppCommand.Serve,
"check" => AppCommand.Check,
@@ -17,7 +17,7 @@ public sealed record CommandLine(AppCommand Command, string? ConfigPath, string?
string? config = null;
string? language = null;
string? transport = null;
- for (int i = 1; i < args.Length; i++)
+ for (int i = implicitServe ? 0 : 1; i < args.Length; i++)
{
string option = args[i];
if (i + 1 >= args.Length) throw new CommandLineException($"Missing value for '{option}'.");