From fa0333cc57b3d2961f2aae2e7b6ddeb9f47a3e64 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Mon, 6 Oct 2025 18:02:52 +0200 Subject: run md and gen when no subcommands are given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert Günzler --- src/main.zig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.zig b/src/main.zig index 04334f1..f1d3cda 100644 --- a/src/main.zig +++ b/src/main.zig @@ -148,15 +148,22 @@ const Cli = struct { _ = argv.skip(); // skip arg0 + if (argv.inner.count == 1) { + try Cli.mdCmd(ctx); + try Cli.genCmd(ctx); + } + while (argv.next()) |arg| { - if (std.mem.eql(u8, arg, "gen")) { + if (std.mem.eql(u8, arg, "help")) { + Cli.helpCmd(ctx); + } else if (std.mem.eql(u8, arg, "gen")) { try Cli.genCmd(ctx); } else if (std.mem.eql(u8, arg, "md")) { try Cli.mdCmd(ctx); } else if (std.mem.eql(u8, arg, "watch")) { try Cli.watchCmd(ctx); } else { - return Cli.helpCmd(ctx); + Cli.helpCmd(ctx); } } } -- cgit 1.4.1