{"id":34988095,"url":"https://github.com/umjammer/klab-commons-cli","last_synced_at":"2026-05-14T16:33:43.997Z","repository":{"id":24034947,"uuid":"27419979","full_name":"umjammer/klab-commons-cli","owner":"umjammer","description":"🍊 Java Command Line Interface w/ Annotation","archived":false,"fork":false,"pushed_at":"2024-09-08T06:03:02.000Z","size":92,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T14:30:38.997Z","etag":null,"topics":["annotation","cli","commons-cli","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umjammer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-12-02T07:11:14.000Z","updated_at":"2024-09-08T06:01:20.000Z","dependencies_parsed_at":"2023-01-14T00:17:06.714Z","dependency_job_id":null,"html_url":"https://github.com/umjammer/klab-commons-cli","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/umjammer/klab-commons-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umjammer%2Fklab-commons-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umjammer%2Fklab-commons-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umjammer%2Fklab-commons-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umjammer%2Fklab-commons-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umjammer","download_url":"https://codeload.github.com/umjammer/klab-commons-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umjammer%2Fklab-commons-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33033197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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":["annotation","cli","commons-cli","java"],"created_at":"2025-12-27T01:43:29.724Z","updated_at":"2026-05-14T16:33:43.991Z","avatar_url":"https://github.com/umjammer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Release](https://jitpack.io/v/umjammer/klab-commons-cli.svg)](https://jitpack.io/#umjammer/klab-commons-cli)\n[![Java CI](https://github.com/umjammer/klab-commons-cli/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/klab-commons-cli/actions/workflows/maven.yml)\n[![CodeQL](https://github.com/umjammer/klab-commons-cli/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/umjammer/klab-commons-cli/actions/workflows/codeql-analysis.yml)\n![Java](https://img.shields.io/badge/Java-17-b07219)\n\n# klab-commons-cli\n\nCommand Line Interface Library with Annotation\n\nThis is the wrapper of [Apache Commons CLI](http://commons.apache.org/proper/commons-cli/).\n\n## Usage\n\n* Before\n\n```Java\n    Options options = new Options();\n\n    options.addOption(OptionBuilder\n        .hasArg(true)\n        .withArgName(\"output path\")\n        .isRequired(true)\n        .withDescription(\"set the output path\")\n        .create('d')\n    );\n\n        ︙\n\n    CommandLineParser parser = new BasicParser();\n    CommandLine cmd = null;\n    try {\n        cmd = parser.parse(options, args);\n    } catch (ParseException e) {\n        new HelpFormatter().printHelp(\"Foo\", options, true);\n        System.exit(-1);\n    }\n\n    Foo foo = new Foo();\n\n    if (cmd.hasOption('d')) {\n        foo.outDir = cmd.getOptionValue('d');\n    }\n\n        ︙\n```\n\n\n* After\n\n```Java\n@Options\npublic class Foo {\n\n    @Option(argName = \"output path\", option = \"d\", args = 1, required = true, description = \"set the output path\")\n    private String outDir;\n\n    :\n\n    public static void main(String[] args) throws Exception {\n        Foo foo = new Foo();\n\n        Options.Util.bind(args, foo);\n\n        ︙\n    }\n```\n\n## References\n\n * [apache-commons-cli](https://commons.apache.org/proper/commons-cli/)\n\n## TODO\n\n * add group functionality?\n * add default value? (just set values into fields?)\n * class binding\n * rename project vavi-commomns-cli\n * BasicParser is deprecated, but Default parser doesn't pass the unit test #test08","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumjammer%2Fklab-commons-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumjammer%2Fklab-commons-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumjammer%2Fklab-commons-cli/lists"}