{"id":19451253,"url":"https://github.com/chandru89new/elm-simple-cli-options-parser","last_synced_at":"2026-06-19T07:31:40.048Z","repository":{"id":142843965,"uuid":"612518425","full_name":"chandru89new/elm-simple-cli-options-parser","owner":"chandru89new","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-15T07:31:42.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-12T01:32:10.702Z","etag":null,"topics":["cli-parser","elm","elm-package"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/chandru89new/elm-simple-cli-options-parser/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chandru89new.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-03-11T07:17:41.000Z","updated_at":"2023-03-15T09:00:07.000Z","dependencies_parsed_at":"2023-07-11T07:16:02.247Z","dependency_job_id":null,"html_url":"https://github.com/chandru89new/elm-simple-cli-options-parser","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chandru89new/elm-simple-cli-options-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru89new%2Felm-simple-cli-options-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru89new%2Felm-simple-cli-options-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru89new%2Felm-simple-cli-options-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru89new%2Felm-simple-cli-options-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chandru89new","download_url":"https://codeload.github.com/chandru89new/elm-simple-cli-options-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru89new%2Felm-simple-cli-options-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34522034,"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-19T02:00:06.005Z","response_time":61,"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-parser","elm","elm-package"],"created_at":"2024-11-10T16:40:59.435Z","updated_at":"2026-06-19T07:31:40.022Z","avatar_url":"https://github.com/chandru89new.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI Options Parser\n\nA very simplistic CLI args parser. If you're looking for a proper / full-fledged one, check out [elm-cli-options-parser](https://github.com/dillonkearns/elm-cli-options-parser).\n\n## Why does this exist?\n\nBuilding a full-fledged CLI command parser is one thing but it felt like an overkill for the kind of simple projects I'm doing right now.\n\nInstead, what I want is something as simple as being able to do this:\n\n```bash\n\u003e options = \"--file ./src/file_path.js --debug\"\n\n\u003e getStringValue \"file\" options\nJust \"./src/file_path.js\"\n\n\u003e getBooleanValue \"debug\" options\nJust True\n\n\u003e getIntValue \"count\" options\nNothing # indicates --count is not present in the command string\n```\n\n## How to use this\n\n- Install `chandru89new/elm-simple-cli-options-parser`\n\n```\n~ elm install chandru89new/elm-simple-cli-options-parser\n```\n\n- Import and use:\n\n```elm\nimport CLIOptionsParser exposing (..)\n\ncommandString = \"--file ./file.js\"\nfile = getStringValue \"file\" commandString\n-- file == Just \"./file.js\"\n```\n\n## Getting different kinds of values out\n\nThe library exposes 4 functions to extract different kinds of values.\n\nTake this CLI string:\n\n```\n--file ./file.js --debug --count 5 --factor 2.5\n```\n\n```bash\n\u003e input = \"--file ./file.js --debug --count 5 --factor 2.5\"\n\n\u003e getStringValue \"file\" input\nJust \"./file.js\" : Maybe String\n\n\u003e getBooleanValue \"debug\" input\nJust True : Maybe Bool\n\n\u003e getIntValue \"count\" input\nJust 5 : Maybe Int\n\n\u003e getFloatValue \"factor\" input\nJust 2.5 : Maybe Float\n```\n\nIf you tried to fetch a flag that does not exist, you get `Nothing`:\n\n```bash\n\u003e getStringValue \"output\" input\nNothing : Maybe String\n```\n\nYou could use the `Nothing` to glean that the user did not pass a flag/option.\n\n## More info\n\nThe string can have both keyword args (`--file=somefile.js`) and positional args (`--file somefile.js`).\n\n```bash\n\u003e input = \"--count=5\"\n\n\u003e getIntValue \"count\" input\nJust 5 : Maybe Int\n\n\u003e input = \"--count 5\"\n\n\u003e getIntValue \"count\" input\nJust 5 : Maybe Int\n```\n\n## But wait, why not \"-\" ?\n\nShort flags / options are cute but can be confusing at times. Is it `-v` or `-V` for version? Does `-h` show help or do something else? Plus, for my needs, `--clarity` trumped everything else.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandru89new%2Felm-simple-cli-options-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchandru89new%2Felm-simple-cli-options-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandru89new%2Felm-simple-cli-options-parser/lists"}