{"id":13532661,"url":"https://github.com/rbardou/clap","last_synced_at":"2025-04-01T21:30:47.365Z","repository":{"id":73875094,"uuid":"299030814","full_name":"rbardou/clap","owner":"rbardou","description":"Command-Line Argument Parsing, imperative style with a consumption mechanism.","archived":false,"fork":false,"pushed_at":"2023-03-26T08:33:14.000Z","size":41,"stargazers_count":25,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-02T19:34:18.193Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbardou.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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}},"created_at":"2020-09-27T12:48:40.000Z","updated_at":"2024-05-24T21:50:09.000Z","dependencies_parsed_at":"2024-01-14T02:22:13.813Z","dependency_job_id":"a749bc9b-12c8-425b-a567-4eba81f4ae5c","html_url":"https://github.com/rbardou/clap","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbardou%2Fclap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbardou%2Fclap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbardou%2Fclap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbardou%2Fclap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbardou","download_url":"https://codeload.github.com/rbardou/clap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246712936,"owners_count":20821819,"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-08-01T07:01:12.695Z","updated_at":"2025-04-01T21:30:47.060Z","avatar_url":"https://github.com/rbardou.png","language":"OCaml","funding_links":[],"categories":["[Ocaml](https://ocaml.org/)"],"sub_categories":["Useful awesome list for Go cli"],"readme":"# Clap: Command-Line Argument Parsing\n\nClap is a library for command-line argument parsing.\nClap works by directly consuming arguments in an imperative way.\nTraditionally, argument parsing in OCaml is done by first defining\na specification (an OCaml value defining the types of arguments),\nand then parsing from this specification.\nThe \"impure\" approach of Clap skips the need to define a specification\nand results in code which is quite simple in practice,\nwith limited boilerplate.\n\nClap does construct a specification internally as arguments are parsed.\nIt uses it to generate the `--help`, following usual man page conventions.\n\n## Installation\n\nClap is available as an opam package:\n\n    opam install clap\n\nTo use it, add `clap` as a dependency in your `dune` file.\n\n## API Documentation\n\nSee [src/clap.mli](src/clap.mli).\n\n## Example\n\nSee [demo/demo.ml](demo/demo.ml).\n\n## The Two Rules\n\nOne limitation of Clap is that you have to follow two rules which are not enforced\nby typing:\n- read named arguments before unnamed arguments;\n- call `Clap.close` before actually using arguments.\n\nThere are exceptions to these rules.\n\n- You can read a named argument after an unnamed argument if you are ok that\n  the named argument cannot appear before the unnamed argument.\n  For instance, if the unnamed argument is a subcommand name and the named argument\n  only exists for this subcommand, you can read the command name first and then\n  decide whether or not to read the named argument. Users will not be able to\n  specify the named argument before the command name but this behavior is usually ok\n  for subcommands.\n\n- If an argument cannot be invalid, i.e. it is not mandatory and all strings\n  are valid values for it, then you can use its value before calling `Clap.close`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbardou%2Fclap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbardou%2Fclap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbardou%2Fclap/lists"}