{"id":17995069,"url":"https://github.com/p0dalirius/lib-parseargs","last_synced_at":"2025-08-01T00:32:19.032Z","repository":{"id":113562544,"uuid":"580841636","full_name":"p0dalirius/lib-parseargs","owner":"p0dalirius","description":"A simple library to parse command line arguments in C++. ","archived":false,"fork":false,"pushed_at":"2023-02-02T20:38:43.000Z","size":40244,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-18T18:50:11.172Z","etag":null,"topics":["arguments","cpp","libra","parse"],"latest_commit_sha":null,"homepage":"","language":"C++","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/p0dalirius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"p0dalirius","patreon":"Podalirius"}},"created_at":"2022-12-21T15:31:11.000Z","updated_at":"2024-09-16T02:32:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"c8b0d33b-21fc-4cff-91f7-be957d81efaf","html_url":"https://github.com/p0dalirius/lib-parseargs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Flib-parseargs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Flib-parseargs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Flib-parseargs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p0dalirius%2Flib-parseargs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p0dalirius","download_url":"https://codeload.github.com/p0dalirius/lib-parseargs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231907802,"owners_count":18444186,"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":["arguments","cpp","libra","parse"],"created_at":"2024-10-29T20:17:51.429Z","updated_at":"2024-12-30T19:53:20.403Z","avatar_url":"https://github.com/p0dalirius.png","language":"C++","readme":"# lib-parseargs\r\n\r\n\u003cp align=\"center\"\u003e\r\n  A simple library to parse command line arguments in C++.\r\n  \u003cbr\u003e\r\n  \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/p0dalirius/lib-parseargs\"\u003e\r\n  \u003ca href=\"https://twitter.com/intent/follow?screen_name=podalirius_\" title=\"Follow\"\u003e\u003cimg src=\"https://img.shields.io/twitter/follow/podalirius_?label=Podalirius\u0026style=social\"\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://www.youtube.com/c/Podalirius_?sub_confirmation=1\" title=\"Subscribe\"\u003e\u003cimg alt=\"YouTube Channel Subscribers\" src=\"https://img.shields.io/youtube/channel/subscribers/UCF_x5O7CSfr82AfNVTKOv_A?style=social\"\u003e\u003c/a\u003e\r\n  \u003cbr\u003e\r\n\u003c/p\u003e\r\n\r\n**Note:** Use at least c++17. \r\n\r\n## Features\r\n\r\n - [x] Optional or required arguments, with default values.\r\n - [x] Positional arguments.\r\n - [x] Default help option (BooleanSwitch) `-h` or `--help` to display help message.\r\n - [x] Parsing of arguments and printing of help message if missing mandatory arguments.b\r\n\r\n![image](./.github/example.png)\r\n\r\n## Example code\r\n\r\n```cpp\r\n#include \u003ciostream\u003e\r\n#include \"ArgumentsParser/ArgumentsParser.h\"\r\n\r\n\r\nArgumentsParser parseArgs(int argc, char* argv[]) {\r\n\tArgumentsParser parser = ArgumentsParser();\r\n\r\n\tparser.add_positional_string_argument(\"mode\", \"Operation mode\");\r\n\tparser.add_positional_string_argument(\"another\", \"Another positional\");\r\n\t\r\n\tparser.add_string_argument(\"target\", \"-t\", \"--target\", \"\", true, \"IP or adress of the target machine\");\r\n\tparser.add_int_argument(\"port\", \"-p\", \"--port\", \"\", true, \"Port of the target machine\");\r\n\r\n\tparser.add_boolean_switch_argument(\"verbose\", \"-v\", \"--verbose\", false, false, \"Verbose mode.\");\r\n\r\n\tparser.parse_args(argc, argv);\r\n\treturn parser;\r\n}\r\n\r\nint main(int argc, char* argv[])\r\n{\r\n\tArgumentsParser parser = parseArgs(argc, argv);\r\n\r\n\tif (std::get\u003cbool\u003e(parser.get_value(\"verbose\")) == true) {\r\n\t\tstd::cout \u003c\u003c \"[verbose] Mode verbose started.\\n\";\r\n\t}\r\n\r\n\tstd::cout \u003c\u003c std::get\u003cint\u003e(parser.get_value(\"port\")) \u003c\u003c \"\\n\";\r\n\r\n\tparser.debug();\r\n}\r\n\r\n```\r\n\r\nOutput:\r\n\r\n```\r\nC:\\Users\\dev\\\u003e .\\PocArgs.exe\r\nUsage: PocArgs.exe \u003cmode\u003e \u003canother\u003e [-p port] [-t target] [-v verbose]\r\n\r\nPositional arguments:\r\n   \u003cmode\u003e   Operation mode\r\n   \u003canother\u003e   Another positional\r\n\r\nRequired arguments:\r\n   -t, --target IP or adress of the target machine\r\n   -p, --port Port of the target machine\r\n\r\nOptional arguments:\r\n   -v, --verbose Verbose mode. (default: false)\r\n\r\n```\r\n","funding_links":["https://github.com/sponsors/p0dalirius","https://patreon.com/Podalirius"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Flib-parseargs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp0dalirius%2Flib-parseargs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp0dalirius%2Flib-parseargs/lists"}