{"id":25612527,"url":"https://github.com/carlobaldassi/bash_optparse","last_synced_at":"2025-04-13T17:50:59.905Z","repository":{"id":142781396,"uuid":"1486480","full_name":"carlobaldassi/bash_optparse","owner":"carlobaldassi","description":"An advanced command line parser for bash intended to be a replacement for getopt / getopts, loosely inspired to python's optparse","archived":false,"fork":false,"pushed_at":"2015-10-31T05:55:26.000Z","size":1849,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T08:45:20.560Z","etag":null,"topics":["bash","option-parser","options-parsing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carlobaldassi.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-03-16T08:43:51.000Z","updated_at":"2019-01-08T19:52:36.000Z","dependencies_parsed_at":"2023-03-15T01:44:42.070Z","dependency_job_id":null,"html_url":"https://github.com/carlobaldassi/bash_optparse","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/carlobaldassi%2Fbash_optparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlobaldassi%2Fbash_optparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlobaldassi%2Fbash_optparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carlobaldassi%2Fbash_optparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carlobaldassi","download_url":"https://codeload.github.com/carlobaldassi/bash_optparse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758154,"owners_count":21156957,"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":["bash","option-parser","options-parsing"],"created_at":"2025-02-22T00:28:18.967Z","updated_at":"2025-04-13T17:50:59.880Z","avatar_url":"https://github.com/carlobaldassi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"BASH OPTPARSE\nan advanced command line\nparsing system for Bash\n========================\n\nCopyright (C) 2011-2012 Carlo Baldassi \u003ccarlobaldassi@gmail.com\u003e\n\nThis program is intended as an advanced replacement of getopt\nfor bash.  Its goals are to improve the simplicity, clarity and\nease of maintenance in the definition of command line parsing rules,\nwhile at the same time adding many additional features, automations\nand more.\n\nIt is somehow similar in spirit to python's optparse, or\nboost::program_options or others, i.e. it provides a framework\nin which the program options and arguments are described in a\ncompact format, leaving to bash_optparse all the work of performing\nparsing, setting default values, implementing dynamic type checks\nand range checks over the value of the variables, auto-generating\na nicely formatted help screen etc.\n\nFurthermore, it can be integrated in bash readline completion.\n\nThe typical usage in a script could be something like this:\n\n. bash_optparse \u003c\u003c EOF\nOPTIONS_BEGIN\n  perc FLOAT x [0:100] 50 \"Select percentage\"\nOPTIONS_END\n\nARGUMENTS_BEGIN\n  infile False \"input file\"\nARGUMENTS_END\nEOF\n\nThe line in the OPTIONS block in the example describes a long\noption named --perc, associated to a varaible of the same name\n($perc), of type FLOAT, whose range is between 0 and 100, and\nwhich defaults to 50. A short option -p is also automatically\nadded as an alias to the long option. Calling the script with\nthe (automatically added) --help option, one would get a\ncorresponding auto-generated help line:\n\n  -p, --perc \u003cx\u003e  Select percentage (\u003cx\u003e=float in [0.0:100.0],\n                  default=50)\n\nThe line in the ARGUMENTS block line describes how to pass an\noptional argument, which will be stored in the variable $infile.\n\nSee `example_script_simple', `example_functions' and\n`example_script' in the `doc' directory for more information.\nThe explanation of the syntax can be found in the comments to the\n`example_script' code.\n\nAlso, see the `README' file in the `completion' directory for\ninformation about the integrtion with bash completion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlobaldassi%2Fbash_optparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarlobaldassi%2Fbash_optparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarlobaldassi%2Fbash_optparse/lists"}