{"id":37808974,"url":"https://github.com/wrfly/gua","last_synced_at":"2026-01-16T15:32:56.347Z","repository":{"id":44448036,"uuid":"176978845","full_name":"wrfly/gua","owner":"wrfly","description":"simple Golang command-line parser,  if you don't need some fancy features, just guá it.","archived":false,"fork":false,"pushed_at":"2023-11-16T06:13:21.000Z","size":22,"stargazers_count":8,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T14:28:24.567Z","etag":null,"topics":["cli","cli-parser","flags","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wrfly.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":"2019-03-21T15:56:55.000Z","updated_at":"2023-08-04T17:31:53.000Z","dependencies_parsed_at":"2023-11-16T04:30:28.979Z","dependency_job_id":"3badb9ec-9d31-47cf-ac30-229bb4282289","html_url":"https://github.com/wrfly/gua","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/wrfly/gua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fgua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fgua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fgua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fgua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrfly","download_url":"https://codeload.github.com/wrfly/gua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fgua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","cli-parser","flags","go","golang"],"created_at":"2026-01-16T15:32:56.247Z","updated_at":"2026-01-16T15:32:56.322Z","avatar_url":"https://github.com/wrfly.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# guá\n\nSomehow I saw this [repo](https://github.com/alexflint/go-arg) and want\nto rewrite a same one using [ecp](https://github.com/wrfly/ecp).\n\nIf you want to convert a golang structure into some command line flags,\njust `guá`.\n\nIt's small and useful for some simple command line tools.\n\n## Example\n\n```golang\npackage main\n\nimport (\n    \"encoding/json\"\n    \"fmt\"\n    \"time\"\n\n    \"github.com/wrfly/gua\"\n)\n\ntype cliFlags struct {\n    Name     string        `name:\"nnnnname\" default:\"wrfly\" desc:\"just a name\"`\n    Age      int           `desc:\"the age\"`\n    Slice    []string      `desc:\"test string slice\"`\n    SliceInt []int         `desc:\"test int slice\" default:\"1 2 3\"`\n    Time     time.Duration `desc:\"test time duration\"`\n    Extra    struct {\n        Loc   string `default:\"home\" desc:\"location\"`\n        Valid bool   `default:\"true\"`\n        Debug bool\n    }\n    Type string `desc:\"A|B|C\"`\n}\n\nfunc main() {\n    cli := new(cliFlags)\n    if err := gua.Parse(cli); err != nil {\n        panic(err)\n    }\n\n    bs, _ := json.MarshalIndent(cli, \"\", \"  \")\n    fmt.Printf(\"%s\\n\", bs)\n}\n```\n\n```bash\n# run the example\n./gua\n{\n  \"Name\": \"wrfly\",\n  \"Age\": 0,\n  \"Slice\": null,\n  \"SliceInt\": [\n    1,\n    2,\n    3\n  ],\n  \"Time\": 0,\n  \"Extra\": {\n    \"Loc\": \"home\",\n    \"Valid\": false,\n    \"Debug\": false\n  },\n  \"Type\": \"\"\n}\n\n\n# show some help message\n./gua -h\nUsage of ./gua:\n -age           the age\n -extra.debug   [false]\n -extra.loc     location   [home]\n -extra.valid   [false]\n -nnnnname      just a name   [wrfly]\n -slice         test string slice\n -sliceInt      test int slice   [1 2 3]\n -time          test time duration\n -type          A|B|C\n\n\n# add some flags\n./gua -age 18 -extra.debug -nnnnname gua \\\n    -slice \"hello world\" -sliceInt \"1 3 5 7\" \\\n    -time 1m -type C\n{\n  \"Name\": \"gua\",\n  \"Age\": 18,\n  \"Slice\": [\n    \"hello\",\n    \"world\"\n  ],\n  \"SliceInt\": [\n    1,\n    3,\n    5,\n    7\n  ],\n  \"Time\": 60000000000,\n  \"Extra\": {\n    \"Loc\": \"home\",\n    \"Valid\": false,\n    \"Debug\": true\n  },\n  \"Type\": \"C\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrfly%2Fgua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrfly%2Fgua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrfly%2Fgua/lists"}