{"id":19196413,"url":"https://github.com/nkcmr/argparse","last_synced_at":"2026-05-16T06:34:27.098Z","repository":{"id":213734397,"uuid":"734804356","full_name":"nkcmr/argparse","owner":"nkcmr","description":"generate next-level arg/param parsing for your bash scripts","archived":false,"fork":false,"pushed_at":"2025-11-28T01:50:32.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-26T21:24:29.011Z","etag":null,"topics":["bash","codegen"],"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/nkcmr.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":"2023-12-22T17:04:05.000Z","updated_at":"2025-11-28T01:50:35.000Z","dependencies_parsed_at":"2023-12-27T17:26:54.741Z","dependency_job_id":null,"html_url":"https://github.com/nkcmr/argparse","commit_stats":null,"previous_names":["nkcmr/argparse"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nkcmr/argparse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcmr%2Fargparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcmr%2Fargparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcmr%2Fargparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcmr%2Fargparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkcmr","download_url":"https://codeload.github.com/nkcmr/argparse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcmr%2Fargparse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33092688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bash","codegen"],"created_at":"2024-11-09T12:13:38.438Z","updated_at":"2026-05-16T06:34:27.093Z","avatar_url":"https://github.com/nkcmr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# argparse\n\ngenerate next-level arg/param parsing for your bash scripts!\n\nthis is a simple tool that allows you to write specially crafted comments in your bash scripts that will then be used to generate a section of the script to parse arguments and flags.\n\nso, if this is in a bash script:\n\n```bash\n#!/bin/bash\n\n# param:one Some help text\n# flag:dry-run Something about --dry-run\n# flag:short,s Demoing the short flag\n\necho \"one:     $param_one\"\necho \"dry-run: $flag_dry_run\"\necho \"short:   $flag_short\"\n```\n\nwill have an `argparse` section spliced in right under the configuration that will parse everything accordingly. (see examples directory for preview of generated code)\n\n## installation\n\nthe only requirement is Go 1.21+\n\n```\ngo install -v code.nkcmr.net/argparse@latest\n```\n\n## config format\n\nthe current format of the config is as follows.\n\n### param\n\nParameters are required, positional arguments. This is the structure of a param config line:\n\n```\nparam:\u003cname: [a-z_][a-z0-9_]*\u003e \u003chelp text\u003e\n```\n\n#### examples\n\n```\nparam:one Will be the first positional argument.\nparam:two Will be the second\nparam:3three INVALID: cannot start with number\n```\n\n### flag\n\nFlags are optional, non-ordered arguments. They can be given a value upon invocation like: `--one two` or if they are passed without a value `--one` it is assumed that the value should just be `true`. This is the structure of a flag config line:\n\n```\nflag:\u003cname: [a-z_][a-z0-9-_]*\u003e(,\u003cshort_flag: [a-z]\u003e)? \u003chelp text\u003e (default: \u003cdefault value\u003e)\n```\n\n#### examples\n\n```\nflag:foo,f Generates a flag that can be \"--foo \u003cvalue\u003e\" or \"-f\"\nflag:bar Generates a flag that can only be \"--bar \u003cvalue\u003e\" or \"--bar\"\nflag:beep Boop description (default: bop)\nflag:1foo INVALID: Will be ignored since it is invalid (cannot start with number)\nflag:,f INVALID: Cannot only be short, must have long name\n```\n\n##### license\n\n```\nCopyright (c) 2023 Nicholas Comer\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkcmr%2Fargparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkcmr%2Fargparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkcmr%2Fargparse/lists"}