{"id":19520912,"url":"https://github.com/sebastianbach/cmdl-args","last_synced_at":"2026-06-15T15:32:17.690Z","repository":{"id":144574008,"uuid":"607320230","full_name":"SebastianBach/cmdl-args","owner":"SebastianBach","description":"A tool that generates C++ code that parses command line arguments.","archived":false,"fork":false,"pushed_at":"2023-03-28T18:53:36.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-19T15:06:52.897Z","etag":null,"topics":["code-generation","command-line-arguments-parser","cpp","cpp20"],"latest_commit_sha":null,"homepage":"","language":"C++","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/SebastianBach.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":"2023-02-27T18:53:38.000Z","updated_at":"2023-03-28T18:53:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2c31108-0975-4e0e-b751-717b2f57b911","html_url":"https://github.com/SebastianBach/cmdl-args","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SebastianBach/cmdl-args","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebastianBach%2Fcmdl-args","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebastianBach%2Fcmdl-args/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebastianBach%2Fcmdl-args/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebastianBach%2Fcmdl-args/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SebastianBach","download_url":"https://codeload.github.com/SebastianBach/cmdl-args/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SebastianBach%2Fcmdl-args/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34369840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["code-generation","command-line-arguments-parser","cpp","cpp20"],"created_at":"2024-11-11T00:28:18.538Z","updated_at":"2026-06-15T15:32:17.663Z","avatar_url":"https://github.com/SebastianBach.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"A tool that generates specific C++ code that parses command line arguments based on a description of the desired arguments.\n\n```\n#include \u003ciostream\u003e\n#include \"parser.h\"\n\nint main(int argc, char* argv[])\n{\n    const auto app_arguments = args::parse(argc, argv);\n\n    if (app_arguments.help) {\n        args::print_help();\n        return 0;\n    }\n\n    if (!app_arguments.input.has_value()) {\n        std::cout \u003c\u003c \"Missing input argument.\";\n        return -1;\n    }\n\n    const auto input = app_arguments.input.value();\n\n    // handle input...\n\n    return 0;\n}\n\n```\n\nThe generated code requires C++ 17 (using ```std::optional```).\n\n\n# Build\n\n```\nmkdir build\ncd build\ncmake ..\ncmake --build . --config Release\nctest -C Release  -VV\n```\n\n# Usage\n\n## Arguments\n\nBasic arguments are:\n- --i: Input File path.\n- --o: Output folder path.\n- --header: Output Header File\n- --cpp: Output Source File.\n\nA typical call would be\n\n```\ncmdl-args.exe --i C:\\my_project\\args.txt --o C:\\my_project\\code --header parser.h --cpp parser.cpp\n```\n\nOptions to configure the resulting code are:\n- --pragma: Use pragma as include guard.\n- --space: Namespace.\n- --hyphen: Characters preceding the arguments.\n- --tab: Tab size in spaces.\n- --comments: Enable comments.\n- --date: Include creation date.\n- --print: Include ```print_help()``` function.\n- --values: Include ```print_values()``` function.\n\n\nFurther options are:\n- --help: Print help text.\n- --version: Print version.\n- --v: Verbose output.\n\n\n## Input File\n\nAn input files is a simple text file describing the desired command line arguments. The format is\n\n```\n\u003cARG\u003e:\u003cTYPE\u003e:\u003cDESCRIPTION\u003e\n```\n\nTypes are\n- **f**: Flag, is either set or not.\n- **s**: String.\n- **d**: Double value.\n- **i**: Integer value.\n\nAs an example:\n\n```\nhelp:f:Print help text\ni:s:Input File\no:s:Output Folder\n```\n\nSee ```src/app/args.txt```.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbach%2Fcmdl-args","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastianbach%2Fcmdl-args","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbach%2Fcmdl-args/lists"}