{"id":15067285,"url":"https://github.com/dustinliu/argparse4k","last_synced_at":"2026-02-13T08:15:53.995Z","repository":{"id":88694119,"uuid":"115679778","full_name":"dustinliu/argparse4k","owner":"dustinliu","description":"command line parser for kotlin","archived":false,"fork":false,"pushed_at":"2018-05-29T23:43:17.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T21:21:57.620Z","etag":null,"topics":["argument-parser","command-line-parser","command-line-tool","kotlin","kotlin-library","option-parser","option-parsing"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/dustinliu.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":"2017-12-29T02:52:51.000Z","updated_at":"2018-05-29T08:04:22.000Z","dependencies_parsed_at":"2023-07-03T10:06:40.999Z","dependency_job_id":null,"html_url":"https://github.com/dustinliu/argparse4k","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dustinliu%2Fargparse4k","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dustinliu%2Fargparse4k/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dustinliu%2Fargparse4k/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dustinliu%2Fargparse4k/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dustinliu","download_url":"https://codeload.github.com/dustinliu/argparse4k/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847057,"owners_count":20357317,"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":["argument-parser","command-line-parser","command-line-tool","kotlin","kotlin-library","option-parser","option-parsing"],"created_at":"2024-09-25T01:19:06.382Z","updated_at":"2025-10-03T19:35:57.702Z","avatar_url":"https://github.com/dustinliu.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/dustinliu/argparse4k.svg?branch=master)](https://travis-ci.org/dustinliu/argparse4k)\n[![codecov](https://codecov.io/gh/dustinliu/argparse4k/branch/master/graph/badge.svg)](https://codecov.io/gh/dustinliu/argparse4k)\n\n# argparse4k\n\n## usage\n```kotlin\nval parser = ArgumentParserImpl(\"testprog\", arrayOf(\"-v\"))\nval version by parser.flag(\"-v\", help = \"help version\")\nval detached by parser.flag(\"-d\", \"--detached\", help = \"fdsf\")\n\nassertEquals(true, version)\nassertEquals(false, detached)\n```\n\n```kotlin\nval parser = ArgumentParserImpl(\"testprog\", arrayOf(\"-foo\", \"bar\"))\nclass TestClass {\n    val foo by parser.value(\"-foo\", metavar = \"ggg\", help = \"fo fo fo\")\n}\n\nval testClass = TestClass()\n\nassertEquals(\"bar\", testClass.foo)\n```\n```kotlin\nval parser = ArgumentParserImpl(\"testprog\", arrayOf(\"-foo\", \"bar\", \"ggg\"))\nclass TestClass  {\n    val foo by parser.values(\"-foo\", metavar = \"ggg\", help = \"fo fo fo\")\n}\n\nval testClass = TestClass()\n\nassertEquals(\"bar\", testClass.foo[0])\nassertEquals(\"ggg\", testClass.foo[1])\n```\n\n```kotlin\nval parser = ArgumentParserImpl(\"testprog\", arrayOf(\"-foo\", \"bar\", \"container\"))\nclass testClass {\n    val foo by parser.value(\"-foo\", metavar = \"ggg\", help = \"fo fo fo\")\n    val container by parser.positional(\"container\", help = \"container name\")\n}\n\nval testClass = TestClass()\n\nassertEquals(\"bar\", testClass.foo)\nassertEquals(\"container\", testClass.container)\n```\n\n```kotlin\nval parser = ArgumentParserImpl(\"testprog\", arrayOf(\"ccc\", \"-v\"))\nval cmdParser = parser.addCommandArgumentParser(\"ccc\")\nclass TestClass {\n    val verbose by parser.flag(\"-v\", help = \"container name\")\n}\n\nclass testClass2 {\n    val verbose by cmdParser.flag(\"-v\")\n}\n\nval testClass = TestClass()\nval testClass2 = TestClass2()\n\nassertEquals(false, testClass.verbose)\nassertEquals(true, testClass2.verbose)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdustinliu%2Fargparse4k","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdustinliu%2Fargparse4k","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdustinliu%2Fargparse4k/lists"}