╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ main.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
52 comptime repo_kind: rp.RepoKind, 53 comptime any_repo_opts: rp.AnyRepoOpts(repo_kind), 54 io: std.Io, 55 allocator: std.mem.Allocator, 56 args: []const []const u8, 57 cwd_path: []const u8, 58 run_opts: RunOpts, 59 ) !void { 60 var cmd_args = try cmd.CommandArgs.init(allocator, args); 61 defer cmd_args.deinit(); 62 63 switch (try cmd.CommandDispatch.init(&cmd_args)) { 64 .invalid => |invalid| switch (invalid) { 65 .command => |command| { 66 try run_opts.err.print("\"{s}\" is not a valid command\n\n", .{command}); 67 try cmd.printHelp(null, run_opts.err); 68 return error.HandledError; 69 }, 70 .argument => |argument| { 71 try run_opts.err.print("\"{s}\" is not a valid argument\n\n", .{argument.value}); 72 try cmd.printHelp(argument.command, run_opts.err); 73 return error.HandledError; 74 }, 75 }, 76 .help => |cmd_kind_maybe| try cmd.printHelp(cmd_kind_maybe, run_opts.out), 77 .cli => |cli_cmd| switch (cli_cmd) { 78 .serve => |options| try srv.run(repo_kind, any_repo_opts, io, allocator, cwd_path, options, run_opts.err, {}), 79 }, 80 } 81 } 82