{"id":30450213,"url":"https://github.com/nochso/fflag","last_synced_at":"2025-08-23T13:25:59.955Z","repository":{"id":50663805,"uuid":"467272925","full_name":"nochso/fflag","owner":"nochso","description":"Go package fflag parses flag.FlagSet from simple configuration files.","archived":false,"fork":false,"pushed_at":"2022-08-06T19:39:17.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T06:31:34.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nochso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-07T22:00:21.000Z","updated_at":"2022-06-30T12:17:43.000Z","dependencies_parsed_at":"2022-09-24T11:02:21.717Z","dependency_job_id":null,"html_url":"https://github.com/nochso/fflag","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nochso/fflag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Ffflag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Ffflag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Ffflag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Ffflag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nochso","download_url":"https://codeload.github.com/nochso/fflag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nochso%2Ffflag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271749048,"owners_count":24814115,"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-08-23T02:00:09.327Z","response_time":69,"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":[],"created_at":"2025-08-23T13:25:54.783Z","updated_at":"2025-08-23T13:25:59.938Z","avatar_url":"https://github.com/nochso.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Code generated by gomarkdoc. DO NOT EDIT --\u003e\n\n# fflag\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/nochso/fflag.svg)](https://pkg.go.dev/github.com/nochso/fflag)\n![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/nochso/fflag?sort=semver)\n![GitHub](https://img.shields.io/github/license/nochso/fflag)\n\n```go\nimport \"github.com/nochso/fflag\"\n```\n\nPackage fflag parses \\[flag.FlagSet\\] from simple configuration files.\n\n## Syntax\n\nKeys \\(flag names without the \"\\-\" prefix\\) followed by values.\n\n```\nflag-name flag-value\n```\n\nComments begin with any of these: \\# ; //\n\nLeading and trailing whitespace is ignored on each line, key and value.\n\n## Index\n\n- [Variables](\u003c#variables\u003e)\n- [func Parse(fs *flag.FlagSet, o *Options) error](\u003c#func-parse\u003e)\n- [func ParseArgs(fs *flag.FlagSet, o *Options, args []string) error](\u003c#func-parseargs\u003e)\n- [func WriteFlagSetConfig(w io.Writer, fs *flag.FlagSet, ignoreFlags ...string)](\u003c#func-writeflagsetconfig\u003e)\n- [type Options](\u003c#type-options\u003e)\n  - [func NewDefaultOptions() *Options](\u003c#func-newdefaultoptions\u003e)\n\n\n## Variables\n\nErrWriteConfig is returned by \\[Parse\\] after the current configuration has been to written to \\[os.Stdout\\].\n\n```go\nvar ErrWriteConfig = errors.New(\"wrote configuration to stdout\")\n```\n\n## func Parse\n\n```go\nfunc Parse(fs *flag.FlagSet, o *Options) error\n```\n\nParse a config file using \\[os.Args\\] into an existing \\[flag.FlagSet\\] before parsing the FlagSet itself.\n\nReturns \\[ErrWriteConfig\\] if the configuration was written to stdout as requested.\n\n## func ParseArgs\n\n```go\nfunc ParseArgs(fs *flag.FlagSet, o *Options, args []string) error\n```\n\nParseArgs parses a config file using given arguments into an existing \\[flag.FlagSet\\] before parsing the FlagSet itself.\n\nReturns \\[ErrWriteConfig\\] if the configuration was written to stdout as requested.\n\n## func WriteFlagSetConfig\n\n```go\nfunc WriteFlagSetConfig(w io.Writer, fs *flag.FlagSet, ignoreFlags ...string)\n```\n\nWriteFlagSetConfig writes a configuration file to w including both default and currently set values \\(should they differ\\).\n\n## type Options\n\nOptions used for parsing a config file.\n\n```go\ntype Options struct {\n    // Path is the default config file path.\n    //\n    // If this file does exist, no error is returned.\n    // If a specific file is given using FlagName, the file must exist.\n    Path string\n\n    // ConfigFlagName is the name of the flag that points to a config file.\n    //\n    // If this flag is invoked a non-existing file will return an error.\n    ConfigFlagName string\n\n    // WriteConfigFlagName is the name of the flag that causes the current\n    // configuration to be printed.\n    WriteConfigFlagName string\n}\n```\n\n### func NewDefaultOptions\n\n```go\nfunc NewDefaultOptions() *Options\n```\n\nNewDefaultOptions returns default options for use in \\[Parse\\].\n\n```\nPath:                \"config.txt\"\nConfigFlagName:      \"config\"\nWriteConfigFlagName: \"write-config\"\n```\n\n\n\nGenerated by [gomarkdoc](\u003chttps://github.com/princjef/gomarkdoc\u003e)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnochso%2Ffflag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnochso%2Ffflag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnochso%2Ffflag/lists"}