{"id":15877722,"url":"https://github.com/ulises-jeremias/simple-parse","last_synced_at":"2025-04-01T23:24:14.897Z","repository":{"id":108551283,"uuid":"121477463","full_name":"ulises-jeremias/simple-parse","owner":"ulises-jeremias","description":"Simple, stupid and portable C argument (argv) parser.","archived":false,"fork":false,"pushed_at":"2019-05-01T04:09:55.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T15:16:06.947Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ulises-jeremias.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":"2018-02-14T06:11:48.000Z","updated_at":"2022-10-10T07:21:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4aa6df5-0218-4413-8ae8-185b963119bc","html_url":"https://github.com/ulises-jeremias/simple-parse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulises-jeremias%2Fsimple-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulises-jeremias%2Fsimple-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulises-jeremias%2Fsimple-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ulises-jeremias%2Fsimple-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ulises-jeremias","download_url":"https://codeload.github.com/ulises-jeremias/simple-parse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246726103,"owners_count":20823733,"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-10-06T02:03:19.289Z","updated_at":"2025-04-01T23:24:14.872Z","avatar_url":"https://github.com/ulises-jeremias.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-parse\n\nMac OS \u003cimg src=\"https://cloud.githubusercontent.com/assets/1885333/17059766/2530c9d8-4ffd-11e6-9529-3fa47dbff616.png\" width=\"50px\"\u003e and \u003cimg src=\"https://cloud.githubusercontent.com/assets/1885333/17059750/11c4474e-4ffd-11e6-89e1-2486ca5b3234.png\" width=\"100px\"\u003e | \u003cimg src=\"https://cloud.githubusercontent.com/assets/1885333/17059763/206a7d4a-4ffd-11e6-859e-7856902fb300.png\" width=\"100px\"\u003e\n------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\nTravis CI: [![Build Status](https://travis-ci.org/ulises-jeremias/simple-parse.svg?branch=master)](https://travis-ci.org/ulises-jeremias/simple-parse)                                                                        | AppVeyor: [![Build status](https://ci.appveyor.com/api/projects/status/mpc8xk0odl5er0lk/branch/master?svg=true)](https://ci.appveyor.com/project/ulises-jeremias/simple-parse/branch/master)\n\nSimple, stupid and portable C argument (argv) parser. SParse is inspired by [cargo](https://github.com/funlibs/cargo). The idea is to expand the functionalities that this library offers, reimplement them and add new ones.\n\n## Build\n\nJust include sparse.h to your project.\n\nSParse tests are built with CMake for all platforms. You can also use the fake configure script provided to set it up on unix:\n\n```sh\n$ ./configure\n$ make\n```\n\n## Example\n\nTo handle the following program arguments:\n\n```sh\n./myprog --flag1 --flag2= --flag3=hello --flag4=\"Hello world\"\n```\n\nYou could write this:\n\n```c\n#include \u003cstdlib.h\u003e\n#include \u003csparse.h\u003e\n\nint main(int argc, char* argv[])\n{\n    char *f1 = sparse_flag(\"flag1\", \"FALSE\", argc, argv);         /* f1 = \"TRUE\" */\n    char *f2 = sparse_flag(\"flag2\", \"defaultval\", argc, argv);    /* f2 = \"\" */\n    char *f3 = sparse_flag(\"flag3\", \"bye\", argc, argv);           /* f3 = \"hello\" */\n    char *f4 = sparse_flag(\"flag4\", \"Bye world\", argc, argv);     /* f4 = \"Hello world\" */\n    char *f5 = sparse_flag(\"flag5\", \"default\", argc, argv);       /* f5 = \"default\" */\n    char *f6 = sparse_flag(\"flag6\", \"FALSE\", argc, argv);         /* f6 = \"FALSE\" */\n\n    return 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulises-jeremias%2Fsimple-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fulises-jeremias%2Fsimple-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fulises-jeremias%2Fsimple-parse/lists"}