{"id":20520915,"url":"https://github.com/owlinux1000/clib","last_synced_at":"2025-09-03T20:47:12.216Z","repository":{"id":144450576,"uuid":"143712215","full_name":"owlinux1000/clib","owner":"owlinux1000","description":"clib is yet another golang command line parser.","archived":false,"fork":false,"pushed_at":"2018-08-22T12:56:47.000Z","size":37,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-28T09:47:09.435Z","etag":null,"topics":["cli","golang","library"],"latest_commit_sha":null,"homepage":"","language":"Go","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/owlinux1000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-08-06T10:20:19.000Z","updated_at":"2018-08-22T12:56:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc4ce071-7713-4543-971d-607c1a841eb9","html_url":"https://github.com/owlinux1000/clib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/owlinux1000/clib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlinux1000%2Fclib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlinux1000%2Fclib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlinux1000%2Fclib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlinux1000%2Fclib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owlinux1000","download_url":"https://codeload.github.com/owlinux1000/clib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owlinux1000%2Fclib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273508854,"owners_count":25118443,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"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","golang","library"],"created_at":"2024-11-15T22:24:37.471Z","updated_at":"2025-09-03T20:47:12.158Z","avatar_url":"https://github.com/owlinux1000.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clib\n\n[![Build Status](https://travis-ci.org/owlinux1000/clib.svg?branch=master)](https://travis-ci.org/owlinux1000/clib)\n[![GoDoc](https://godoc.org/github.com/owlinux1000/clib?status.svg)](https://godoc.org/github.com/owlinux1000/clib)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE.txt)\n\n\nclib is yet another golang command line parser.\n\n## Install\n\n```\n$ go get github.com/owlinux1000/clib\n```\n\n## Example\n\nHere is a sample implemented like ```git add -u``` .\n\n```go\npackage main\n\nimport (\n    \"os\"\n    \"fmt\"\n    \"github.com/owlinux1000/clib\"\n)\n\nfunc main() {\n\n    app, err := clib.NewApp(\"mygit\", \"1.0.0\", \"A toy git client\")\n    if err != nil {\n        panic(err)\n    }\n    \n    if err := app.AddCommand(\"add\", \"a\", \"Add file contents to the index\", 0); err != nil {\n        panic(err)\n    }\n    \n    if err := app.AddOption(\"-u\", \"update tracked files\", 0); err != nil {\n        panic(err)\n    }\n    \n    exitStatus, err := app.Parse(os.Args)\n    if err != nil {\n        panic(err)\n    }\n\n    if ok, _ := app.OptionFlag(\"-h\"); ok {\n        fmt.Println(app.Usage())\n        os.Exit(exitStatus)\n    }\n\n    if ok, _ := app.CommandFlag(\"add\"); ok {\n        fmt.Println(\"You executed `mygit add`\")\n        if ok, _ := app.OptionFlag(\"-u\"); ok {\n            fmt.Println(\"You executed `mygit add -u`\")\n        }\n    }\n    \n}\n```\n\nThe result executed `go run` is here.\n\n```\n$ mygit\n\nA toy git client\n\nUsage: \n\tmygit [option]\n\tmygit \u003ccommand\u003e\n\nOptions:\n\t-h\t\tDisplay this message\n\t-u\t\tupdate tracked files\n\t-v\t\tPrint version info and exit\n\nCommands:\n\tadd\t\tAdd file contents to the index\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowlinux1000%2Fclib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowlinux1000%2Fclib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowlinux1000%2Fclib/lists"}