╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ command.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
259 } 260 return dispatch; 261 } 262 263 pub fn initIgnoreUnused(cmd_args: *CommandArgs) !CommandDispatch(repo_kind, hash_kind) { 264 const show_help = cmd_args.contains("--help"); 265 266 if (cmd_args.command_kind) |command_kind| { 267 if (show_help) { 268 return .{ .help = command_kind }; 269 } else if (try Command(repo_kind, hash_kind).initMaybe(cmd_args)) |cmd| { 270 return .{ .cli = cmd }; 271 } else { 272 return .{ .help = command_kind }; 273 } 274 } else if (cmd_args.command_name) |command_name| { 275 return .{ .invalid = .{ .command = command_name } }; 276 } else if (show_help) { 277 return .{ .help = null }; 278 } else { 279 return .{ .help = null }; 280 } 281 } 282 }; 283 } 284