{"id":19253427,"url":"https://github.com/stevearc/parseargs","last_synced_at":"2025-06-23T08:39:43.018Z","repository":{"id":139186911,"uuid":"44223476","full_name":"stevearc/parseargs","owner":"stevearc","description":"Bash utility for parsing commandline arguments","archived":false,"fork":false,"pushed_at":"2017-11-11T16:46:08.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T08:51:59.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/stevearc.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":"2015-10-14T04:14:05.000Z","updated_at":"2023-03-07T20:32:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"e104cd53-d843-4178-a9a6-3d78a4e85f30","html_url":"https://github.com/stevearc/parseargs","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/stevearc%2Fparseargs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fparseargs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fparseargs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fparseargs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevearc","download_url":"https://codeload.github.com/stevearc/parseargs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240347981,"owners_count":19787237,"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":[],"created_at":"2024-11-09T18:30:52.479Z","updated_at":"2025-02-23T17:12:57.434Z","avatar_url":"https://github.com/stevearc.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parseargs\n[![Build Status](https://travis-ci.org/stevearc/parseargs.svg?branch=master)](https://travis-ci.org/stevearc/parseargs)\n\nBash utility for parsing commandline arguments inspired by [docopt](http://docopt.org/)\n\nRequires bash\u003e=4.0\n\nExample:\n```bash\n# Set the USAGE environment variable\nUSAGE=\"$0 \u003crequired_arg\u003e [\u003coptional_arg\u003e] [\u003copt_repeating_arg\u003e...]\n\nOptions:\n  -s                   Short flag\n  -a ARG               Short arg\n  --long               Long flag\n  --longarg=LARG       Long arg\n  -f, --flag           Short \u0026 long flag\n  -r RARG, --arg=RARG  Short \u0026 long arg\n\"\n\nsource parseargs.sh\nparseargs \"$@\"\n# Now all the args are set as environment variables\necho \"Required arg: $REQUIRED_ARG\"\n[ -n \"$OPTIONAL_ARG\" ] \u0026\u0026 echo \"Optional arg: $OPTIONAL_ARG\"\n[ -n \"$OPT_REPEATING_ARG\" ] \u0026\u0026 echo \"Optional repeating arg: $OPT_REPEATING_ARG\"\n[ -n \"$S\" ] \u0026\u0026 echo \"short flag set\"\n[ -n \"$ARG\" ] \u0026\u0026 echo \"short arg set: $ARG\"\n[ -n \"$LONG\" ] \u0026\u0026 echo \"long flag set\"\n[ -n \"$LARG\" ] \u0026\u0026 echo \"long arg set: $LARG\"\n[ -n \"$FLAG\" ] \u0026\u0026 echo \"short/long flag set\"\n[ -n \"$RARG\" ] \u0026\u0026 echo \"short/long arg set: $RARG\"\n```\n\nYou can also pass the usage string in directly if you'd prefer not to set `USAGE`:\n```bash\nmyusage=\"$0 ...\"\nparseargs \"$myusage\" \"$@\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevearc%2Fparseargs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevearc%2Fparseargs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevearc%2Fparseargs/lists"}