{"id":19113733,"url":"https://github.com/spiffgreen/cli-master","last_synced_at":"2025-10-09T22:12:47.708Z","repository":{"id":114585620,"uuid":"394262193","full_name":"SpiffGreen/cli-master","owner":"SpiffGreen","description":"A command line utility library that simplifies the development of command line apps. Made for flexibility and simplicity.","archived":false,"fork":false,"pushed_at":"2021-08-18T14:09:25.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T11:44:03.748Z","etag":null,"topics":["cli","commandline","cplusplus","cpp","cpp-library"],"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/SpiffGreen.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":"2021-08-09T11:19:30.000Z","updated_at":"2025-02-20T03:06:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e5e5a2c-e1c2-4dcf-89d3-2e318ef8d430","html_url":"https://github.com/SpiffGreen/cli-master","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SpiffGreen/cli-master","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpiffGreen%2Fcli-master","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpiffGreen%2Fcli-master/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpiffGreen%2Fcli-master/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpiffGreen%2Fcli-master/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpiffGreen","download_url":"https://codeload.github.com/SpiffGreen/cli-master/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpiffGreen%2Fcli-master/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002128,"owners_count":26083307,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["cli","commandline","cplusplus","cpp","cpp-library"],"created_at":"2024-11-09T04:37:58.476Z","updated_at":"2025-10-09T22:12:47.673Z","avatar_url":"https://github.com/SpiffGreen.png","language":"C++","readme":"## Cli-Master\n\nA command line utility library that simplifies the development of command line apps. Made for flexibility and simplicity.\n\n### Installation\nSimply download and place the Cli_Master.h file in the c++ compiler include directory or in your project folder\nThe file can be gotten [Here](./climaster.h). The [climaster.h](./climaster.h) also requires a file for some simple function, [util.h](./util.h).\n\n### Development\nThis project was tested with a MinGW C++ compiler. Included in this repository is a build and run [script](./build_and_run.sh) to ease development process.\n\n`How to use the build script`\n* Simple run the script but pass the name of the file without extension.\n```sh\n# source file name -\u003e main.cpp\n$ ./build_and_run.sh main\n```\nThis will generate a main.exe file and run it. If an error occurs during the compile process the executable won't run.\n\n### Requirements\nThis project was tested using a gcc compiler, target MinGW32.\nC++11.\n\n### Documentation\nCli-Master provides a class with some useful functions.\n* `description`  This function sets the description for your program. It accepts only one parameter: ```string```\n* `version` This method like the description method sets the version of your program\n* `option` This method is dedicated to adding flags your command-line program will accept. It accepts three parameters all ```string```:\n    * `Flag` - format `\"\u003cshort\u003e, \u003clong\u003e\"`. Example:\n    `\"-l, --length\"`\n    * `Description` - A simple description of the purpose of a flag\n    * `defaultValue` - A default value for a flag\n* `parse` This method accepts two parameters: the `no. of arguments` passed to your program from `main(int argc, char** argv)`, a pointer to the arguments. This will form the values needed by your application.\n* `opts` This method takes no parameters and simply returns a `map\u003cstring, string\u003e` of flags and their values.\n\n### Notes\n* Opts will return an empty map if parse is not called before it.\n* Boolean based flags will have a value of `'true'` in the opts map.\n\n### Example\nA simple command line program that expect two kinds of cli options `firstname` and `lastname`. If any other option is used the help menu is printed.\n```c++\n#include \"Cli_Master.h\"\n#include \u003cmap\u003e\nusing namespace std;\nint main(int argc, char** argv) {\n    Cli_Master program;\n    program.description(\"This is the first version of the Cli_Master C++ library for building command line apps\");\n    program.version(\"v1.0.0\");\n    program.option(\"-f, --firstname\", \"your first name\", \"John\");\n    program.option(\"-l, --lastname\", \"your last name\", \"Doe\");\n    program.option(\"-S, --save\", \"save generated details to file, details.txt\", \"true\");\n    program.parse(argc, argv);\n    auto m = program.opts(); // Returns a map of the arguments with values. This map is used by the commandline-application.\n    if(!m.empty()) {\n        map\u003cstring, string\u003e::iterator itr;\n        for(itr = m.begin(); itr != m.end(); itr++) {\n            println(\"Key: \" + itr-\u003efirst + \", Value: \" + itr-\u003esecond);\n        }\n    }\n    return 0;\n}\n```\n\n### Author\n[Spiff Jekey-Green](https://github.com/SpiffGreen)\n\n### License\nCli-Master is [MIT](./LICENSE) licensed","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiffgreen%2Fcli-master","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspiffgreen%2Fcli-master","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiffgreen%2Fcli-master/lists"}