{"id":19251951,"url":"https://github.com/thrawn01/argsini","last_synced_at":"2025-02-23T16:49:06.198Z","repository":{"id":66408576,"uuid":"93902426","full_name":"thrawn01/argsini","owner":"thrawn01","description":"Parse INI config files for use with args parser","archived":false,"fork":false,"pushed_at":"2017-06-10T00:03:58.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T06:42:15.081Z","etag":null,"topics":["args","cli","golang","ini"],"latest_commit_sha":null,"homepage":"","language":"Go","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/thrawn01.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}},"created_at":"2017-06-09T22:51:39.000Z","updated_at":"2023-02-15T23:07:54.000Z","dependencies_parsed_at":"2023-02-24T00:31:03.136Z","dependency_job_id":null,"html_url":"https://github.com/thrawn01/argsini","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/thrawn01%2Fargsini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thrawn01%2Fargsini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thrawn01%2Fargsini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thrawn01%2Fargsini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thrawn01","download_url":"https://codeload.github.com/thrawn01/argsini/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240347818,"owners_count":19787234,"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":["args","cli","golang","ini"],"created_at":"2024-11-09T18:24:46.459Z","updated_at":"2025-02-23T16:49:06.178Z","avatar_url":"https://github.com/thrawn01.png","language":"Go","readme":"[![Coverage Status](https://img.shields.io/coveralls/thrawn01/args-etcd.svg)](https://coveralls.io/github/thrawn01/args-etcd)\n[![Build Status](https://img.shields.io/travis/thrawn01/args-etcd/master.svg)](https://travis-ci.org/thrawn01/args-etcd)\n\n## Introduction\nThis repo provides an ini key=value storage backend for use with\n [args](http://github.com/thrawn01/args)\n\n## Installation\n```\n$ go get github.com/thrawn01/argsini\n```\n\n## Usage\n```go\n    import (\n    \t\"github.com/thrawn01/args\"\n        \"github.com/thrawn01/argsini\"\n    )\n\n\tparser := args.NewParser()\n\tparser.AddOption(\"listen-address\").Help(\"Specify local address to listen on\")\n\tparser.AddOption(\"config\").Short(\"c\").Required().Default(\"/etc/app/config.ini\").\n\t    Help(\"Specify configuration file\")\n\tparser.AddOption(\"cache-size\").IsInt().Default(150).\n\t    Help(\"Specify the size of the cache in entries\")\n\n\t// Parse the command line args\n\topt := parser.ParseOrExit(nil)\n\n    // Create a new backend object\n    backend := argsini.NewFromFile(opt.String(\"config\"), \"\")\n\n    // Load the config file specified on the command line\n    opts, err := parser.FromBackend()\n\tif err != nil {\n\t\tfmt.Printf(\"config error - %s\\n\", err.Error())\n\t}\n\n    // Print out the loaded config items\n    fmt.Printf(\"listen-address: %s\\n\", opts.String(\"listen\"))\n    fmt.Printf(\"cache-size: %d\\n\", opts.Int(\"listen\"))\n\n    // Watch ini file for any configuration changes\n    cancelWatch := parser.Watch(backend, func(event *args.ChangeEvent, err error) {\n        if err != nil {\n            fmt.Println(err.Error())\n            return\n        }\n        fmt.Printf(\"Changed Event - %+v\\n\", event)\n        // This takes a ChangeEvent and update the opts with the latest changes\n        parser.Apply(opts.FromChangeEvent(event))\n    })\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthrawn01%2Fargsini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthrawn01%2Fargsini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthrawn01%2Fargsini/lists"}