{"id":13801007,"url":"https://github.com/xuwei-k/optparse-applicative","last_synced_at":"2025-04-23T04:22:56.797Z","repository":{"id":31373390,"uuid":"127682047","full_name":"xuwei-k/optparse-applicative","owner":"xuwei-k","description":"Scala port of Paolo Capriotti's optparse-applicative library. fork from https://github.com/bmjames/scala-optparse-applicative","archived":false,"fork":false,"pushed_at":"2025-03-17T09:39:50.000Z","size":322,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-17T19:18:04.267Z","etag":null,"topics":["applicative","command-line-parser","scala","scala-js","scala-native","scalaz"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/xuwei-k.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-02T00:16:15.000Z","updated_at":"2025-03-17T09:39:54.000Z","dependencies_parsed_at":"2023-02-15T20:20:22.332Z","dependency_job_id":"2e391f14-6363-44f5-ad11-05bd2ce02293","html_url":"https://github.com/xuwei-k/optparse-applicative","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwei-k%2Foptparse-applicative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwei-k%2Foptparse-applicative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwei-k%2Foptparse-applicative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuwei-k%2Foptparse-applicative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuwei-k","download_url":"https://codeload.github.com/xuwei-k/optparse-applicative/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250367558,"owners_count":21418921,"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":["applicative","command-line-parser","scala","scala-js","scala-native","scalaz"],"created_at":"2024-08-04T00:01:18.531Z","updated_at":"2025-04-23T04:22:56.776Z","avatar_url":"https://github.com/xuwei-k.png","language":"Scala","funding_links":[],"categories":["Console"],"sub_categories":[],"readme":"scala-optparse-applicative\n==========================\n\n[![scaladoc](https://javadoc.io/badge2/com.github.xuwei-k/optparse-applicative_2.13/javadoc.svg)](https://javadoc.io/doc/com.github.xuwei-k/optparse-applicative_2.13/latest/optparse_applicative/index.html)\n\nA port of the [optparse-applicative][1] library to the Scala programming language.\n\nMost functionality has been ported, except completion.\n\nThis library depends on [Scalaz][2] for functional data structures, type classes and combinators.\n\nHow to get it\n-------------\n\nfor jvm\n\n```scala\nlibraryDependencies += \"com.github.xuwei-k\" %% \"optparse-applicative\" % \"0.9.4\"\n```\n\n\nfor scala-js, scala-native\n\n```scala\nlibraryDependencies += \"com.github.xuwei-k\" %%% \"optparse-applicative\" % \"0.9.4\"\n```\n\n\nLicense\n-------\nThis library is distributed under a [BSD 3-Clause][3] license (see `LICENSE`).\n\nSimple example\n--------------\n\nThis example follows the one from the [optparse-applicative][1] docs.\n\n```scala\ncase class Sample(hello: String, quiet: Boolean)\n\nobject SampleMain {\n\n  val sample: Parser[Sample] =\n    ^(\n      strOption(long(\"hello\"), metavar(\"TARGET\"), help(\"Target for the greeting\")),\n      switch(long(\"quiet\"), help(\"Whether to be quiet\"))\n    )(Sample.apply)\n\n  def greet(s: Sample): Unit = s match {\n    case Sample(h, false) =\u003e println(\"Hello, \" ++ h)\n    case _ =\u003e\n  }\n\n  def main(args: Array[String]): Unit = {\n    val opts = info(sample \u003c*\u003e helper,\n      progDesc(\"Print a greeting for TARGET\"),\n      header(\"hello - a test for scala-optparse-applicative\"))\n    greet(execParser(args, \"SampleMain\", opts))\n  }\n\n}\n```\n\nWhen run with the `--help` option, it prints:\n\n    hello - a test for scala-optparse-applicative\n    \n    Usage: SampleMain --hello TARGET [--quiet]\n      Print a greeting for TARGET\n    \n    Available options:\n      -h,--help                Show this help text\n      --hello TARGET           Target for the greeting\n      --quiet                  Whether to be quiet\n\n\nScalaz 7.2.x\n--------------\n\n\u003chttps://github.com/xuwei-k/optparse-applicative/tree/0.8.x\u003e\n\n[1]: https://hackage.haskell.org/package/optparse-applicative\n[2]: https://github.com/scalaz/scalaz\n[3]: http://opensource.org/licenses/BSD-3-Clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuwei-k%2Foptparse-applicative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuwei-k%2Foptparse-applicative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuwei-k%2Foptparse-applicative/lists"}