{"id":16122110,"url":"https://github.com/foxcapades/lib-d-opts","last_synced_at":"2025-04-06T11:41:27.234Z","repository":{"id":90411140,"uuid":"149359625","full_name":"Foxcapades/lib-d-opts","owner":"Foxcapades","description":null,"archived":false,"fork":false,"pushed_at":"2019-07-08T13:08:05.000Z","size":44,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-12T17:19:25.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Foxcapades.png","metadata":{"files":{"readme":"readme.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-09-18T22:29:13.000Z","updated_at":"2018-09-20T18:45:43.000Z","dependencies_parsed_at":"2023-03-13T17:58:36.928Z","dependency_job_id":null,"html_url":"https://github.com/Foxcapades/lib-d-opts","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"abd16393d975bcf62487650703ef815de9526cca"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-d-opts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-d-opts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-d-opts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-d-opts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Foxcapades","download_url":"https://codeload.github.com/Foxcapades/lib-d-opts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478234,"owners_count":20945262,"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-10-09T21:09:24.279Z","updated_at":"2025-04-06T11:41:27.213Z","avatar_url":"https://github.com/Foxcapades.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"= CLI Arg Parser\n:source-highlighter: pygments\n:icons: font\n\nA clumsy and inconvenient CLI argument parser written in D.\n\n== Features\n\n* Short flags `-f`\n** With optional values `-f [value]`\n** With mandatory values `-f \u003cvalue\u003e`\n** That can be specified multiple times `-f -f -fff`\n* Long flags `--foo`\n** With optional values `--foo[=value]`\n** With mandatory values `--foo=\u003cvalue\u003e`\n** That can be specified multiple times `--foo --foo -ff --foo`\n* Positional parameters\n\n.app.d\n[source, d]\n----\nimport std.stdio;\n\nimport eph.args;\n\nvoid main(const string[] args)\n{\n  Argument  count = new Argument().shortFlag('c');\n  Argument  flag  = new Argument().longFlag(\"flag\").shortFlag('f').requireParam();\n  Parameter param = new Parameter();\n  ArgParser parse = new ArgParser().register(count, flag).register(param);\n\n  parse.parse(args);\n\n  writefln(\"count: %d\", count.uses());\n  writefln(\"flag: %s\", flag.values());\n  writefln(\"param: %s\", param.value());\n  writefln(\"extra (unknown values): %s\", parse.remainder());\n  writefln(\"passthrough: %s\", parse.passthrough());\n}\n----\n\n.run\n[source, bash session]\n----\n$ ./app -cffoo -ccc --flag=bar fizz buzz -- some passthrough values\ncount: 4\nflag: [\"foo\", \"bar\"]\nparam: fizz\nextra (unknown values): [\"buzz\"]\npassthrough: [\"some\", \"passthrough\", \"values\"]\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Flib-d-opts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxcapades%2Flib-d-opts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Flib-d-opts/lists"}