{"id":21243836,"url":"https://github.com/meysampg/scala-autoconf","last_synced_at":"2025-06-10T08:35:34.248Z","repository":{"id":82279732,"uuid":"585498905","full_name":"meysampg/scala-autoconf","owner":"meysampg","description":"Just Another Command Line Arguments Parser for Scala","archived":false,"fork":false,"pushed_at":"2023-01-06T12:35:25.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T04:25:24.513Z","etag":null,"topics":["cli-parser","commandlineparser","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/meysampg.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-01-05T10:24:44.000Z","updated_at":"2023-04-05T08:16:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c184d94-fdda-48a6-a807-38b1edc99470","html_url":"https://github.com/meysampg/scala-autoconf","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/meysampg%2Fscala-autoconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meysampg%2Fscala-autoconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meysampg%2Fscala-autoconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meysampg%2Fscala-autoconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meysampg","download_url":"https://codeload.github.com/meysampg/scala-autoconf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meysampg%2Fscala-autoconf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259039215,"owners_count":22796777,"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":["cli-parser","commandlineparser","scala"],"created_at":"2024-11-21T01:14:10.126Z","updated_at":"2025-06-10T08:35:34.240Z","avatar_url":"https://github.com/meysampg.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"Scala CLI AutoConf\n==================\n```scala\npackage com.github.meysampg.sample\n\nimport com.github.meysampg.autoconf.Parser\nimport com.github.meysampg.autoconf.{Argument, Config}\n\n@Config\nclass SampleConfig\n(\n  @Argument(\"name\", \"name to show\")\n  val name: String,\n  @Argument(\"iteration\", \"count of iteration\")\n  val iteration: Int,\n  @Argument(\"only-even-numbers\", \"print name only for even numbers\")\n  val onlyEvenNumbers: Option[Boolean], // make optional argument with Option type\n  @Argument(\"pre-line-char\", \"characters to print before each line\")\n  val preLine: String = \"\u003e\u003e\u003e \", // make optional with default value\n  @Argument(\"post-line-seq\", \"show characters after the line\")\n  val postLine: Seq[String],\n)\n\nobject Main {\n\tdef print(pr: String, i: Int, name: String, po: Seq[String]): Unit =\n\t\tprintln(s\"${pr}$i ${name} ${po.mkString(\" \")}\")\n\n\tdef main(args: Array[String]): Unit = {\n\t\tval config: SampleConfig = Parser(args).as[SampleConfig]\n\t\tif (config.onlyEvenNumbers.isDefined)\n\t\t\tRange(0, config.iteration).withFilter(_ % 2 == 0)\n\t\t\t  .foreach(i =\u003e print(config.preLine, i, config.name, config.postLine))\n\t\telse\n\t\t\tRange(0, config.iteration)\n\t\t\t  .foreach(i =\u003e print(config.preLine, i, config.name, config.postLine))\n\t}\n}\n```\n\n```shell\n$ java target/autoconf.jar com.github.meysampg.sample.Main --name Meysam --iteration 5 --only-even-numbers --pre-line-char !!!\n!!!0 Meysam\n!!!2 Meysam\n!!!4 Meysam\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeysampg%2Fscala-autoconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeysampg%2Fscala-autoconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeysampg%2Fscala-autoconf/lists"}