{"id":18427156,"url":"https://github.com/fjebaker/clippy","last_synced_at":"2025-04-13T19:38:53.123Z","repository":{"id":228242283,"uuid":"773479258","full_name":"fjebaker/clippy","owner":"fjebaker","description":"A comptime-configured argument parser for Zig with help and completion generation.","archived":false,"fork":false,"pushed_at":"2025-03-16T15:05:59.000Z","size":179,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T01:06:58.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fjebaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-17T19:14:26.000Z","updated_at":"2025-03-16T15:06:02.000Z","dependencies_parsed_at":"2024-04-01T17:28:26.818Z","dependency_job_id":"dc9358ab-d134-46c2-b9db-b8eada0d8fd8","html_url":"https://github.com/fjebaker/clippy","commit_stats":null,"previous_names":["fjebaker/clippy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Fclippy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Fclippy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Fclippy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjebaker%2Fclippy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fjebaker","download_url":"https://codeload.github.com/fjebaker/clippy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248769470,"owners_count":21158817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T05:09:48.495Z","updated_at":"2025-04-13T19:38:53.113Z","avatar_url":"https://github.com/fjebaker.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clippy\n\nA pretty minimal declarative compile time argument parser.\n\n## Usage\n\nSee the `examples` directory for more example uses. The basic usage for parsing simple arguments is:\n```zig\nconst std = @import(\"std\");\nconst clippy = @import(\"clippy\");\n\nconst Arguments = clippy.Arguments(\u0026.{\n    .{\n        .arg = \"file\",\n        .help = \"Path to file.\",\n        .required = true,\n    },\n    .{\n        .arg = \"-v\",\n        .help = \"Verbose.\",\n    },\n    .{\n        .arg = \"-a/--algorithm alg\",\n        .help = \"Which algorithm to use (by index).\",\n        .argtype = usize,\n        .default = \"2\",\n    },\n});\n\npub fn main() !void {\n    // ...\n\n    const args = try std.process.argsAlloc(allocator);\n    defer std.process.argsFree(allocator, args);\n\n    // miss out the program name, unless you want to parse it\n    var itt = clippy.ArgumentIterator.init(args[1..]);\n    var parser = Arguments.init(\u0026itt, .{});\n    const parsed = try parser.parseAll();\n\n    std.debug.print(\"File    : {s}\\n\", .{parsed.file});\n    std.debug.print(\"Verbose : {any}\\n\", .{parsed.v});\n    std.debug.print(\"Alg     : {d}\\n\", .{parsed.algorithm});\n\n    // ...\n\n    try Arguments.writeHelp(writer, .{});\n\n    // ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffjebaker%2Fclippy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffjebaker%2Fclippy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffjebaker%2Fclippy/lists"}