{"id":13532546,"url":"https://github.com/oliverdelancey/clapfn","last_synced_at":"2025-08-10T22:13:18.467Z","repository":{"id":43692698,"uuid":"298901203","full_name":"oliverdelancey/clapfn","owner":"oliverdelancey","description":"A fast and simple command line argument parser for Nim","archived":false,"fork":false,"pushed_at":"2024-08-02T22:00:09.000Z","size":29,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T00:25:08.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nim","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/oliverdelancey.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":"2020-09-26T21:19:14.000Z","updated_at":"2024-09-12T13:20:07.000Z","dependencies_parsed_at":"2024-12-14T15:05:36.942Z","dependency_job_id":"b7441da3-a29d-4f71-8f91-0193b01ae805","html_url":"https://github.com/oliverdelancey/clapfn","commit_stats":null,"previous_names":["oliversandli/clapfn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverdelancey%2Fclapfn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverdelancey%2Fclapfn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverdelancey%2Fclapfn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverdelancey%2Fclapfn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverdelancey","download_url":"https://codeload.github.com/oliverdelancey/clapfn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242014722,"owners_count":20057880,"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:11.756Z","updated_at":"2025-03-05T11:17:38.538Z","avatar_url":"https://github.com/oliverdelancey.png","language":"Nim","funding_links":[],"categories":["[Nim](https://nim-lang.org/)"],"sub_categories":["Useful awesome list for Go cli"],"readme":"# clapfn\n\n[![Language](https://img.shields.io/badge/language-nim-yellow?style=flat-square\u0026logo=nim\")](https://nim-lang.org/)\n[![Nimble](https://img.shields.io/badge/nimble%20repo-clapfn-yellowgreen?style=flat-square\u0026\")](https://nimble.directory/pkg/clapfn)\n[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square\u0026logo=github\")](https://github.com/oliverdelancey/clapfn/blob/master/LICENSE\")\n\n`clapfn` is an easy-to-use **C**ommand **L**ine **A**rgument **P**arser **F**or **N**im.\n\nPlease contact me if you have any issues using this library. This library is actively \nmaintained and supported; I haven't made any commits lately simply because this project\nseems to be stable. But feel free to contact me via an issue, and I will see what I can\ndo!\n\n## Installation\n\nInstalling is as simple as:\n```bash\nnimble install clapfn\n```\n\n## Usage\n\n`clapfn` is specifically designed to be straightforward to work with.\n```nim\nimport tables\nimport clapfn\n\nvar parser = ArgumentParser(programName: \"mcp\", fullName: \"My Cool Program\",\n                            description: \"A test program.\", version: \"0.0.0\",\n                            author: \"An Author \u003cauthor@domain.com\u003e\")\n\n# See the wiki for in-depth documentation, especially the purposes\n# of the various parameters.\n\n# It is not necessary to use the argument names; they are here\n# simply for explanation. *All* function arguments are required.\nparser.addRequiredArgument(name=\"in_file\", help=\"Input file.\")\nparser.addStoreArgument(shortName=\"-o\", longName=\"--out\", usageInput=\"output\",\n                        default=\"out.file\", help=\"Specify the output file.\")\nparser.addSwitchArgument(shortName=\"-d\", longName=\"--debug\", default=false,\n                         help=\"Enable debug printing.\")\n\nlet args = parser.parse()\n\necho args[\"in_file\"]\necho args[\"out\"]\necho args[\"debug\"]\n```\n\nAnd if you were to run `mcp --help`:\n```\nMy Cool Program v0.0.0\nAn Author \u003cauthor@domain.com\u003e\nA test program.\n\nUsage: mcp [-h] [-v] [-o output] [-d] in_file\n\nRequired arguments:\n    in_file                  Input file.\n\nOptional arguments:\n    -h, --help               Show this help message and exit.\n    -v, --version            Show version number and exit.\n    -o=output, --out=output  Specify the output file.\n    -d, --debug              Enable debug printing.\n```\n\n`clapfn` uses Nim's default delimiter style:\n```bash\n# good\n-o:output\n-o=output\n\n# BAD\n-o output\n```\n\nThe values of the command line arguments are stored in a [Table](https://nim-lang.org/docs/tables.html), and can be accessed thus:\n```nim\nargs[\"in_file\"]\nargs[\"out\"]\nargs[\"debug\"]\n# etc\n```\n\nSee `example.nim` for a fully functional example.\n\n## Documentation\n\nSee the [wiki](https://github.com/oliverdelancey/clapfn/wiki) for documentation.\n\n## License\n\nThis project uses the [MIT License](https://github.com/oliverdelancey/clapfn/blob/master/LICENSE)\n\n## Contact\n\nRaise an Issue! I'll see you there.\n\nProject link: [https://github.com/oliverdelancey/clapfn](https://github.com/oliverdelancey/clapfn)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverdelancey%2Fclapfn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverdelancey%2Fclapfn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverdelancey%2Fclapfn/lists"}