{"id":15912867,"url":"https://github.com/tintinweb/legacyoptparse","last_synced_at":"2026-06-30T15:32:07.348Z","repository":{"id":6275414,"uuid":"7509130","full_name":"tintinweb/LegacyOptparse","owner":"tintinweb","description":"Simple to use Optparser with minimal dependencies and automatic usage/help generation","archived":false,"fork":false,"pushed_at":"2013-08-19T18:24:21.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-15T16:40:32.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tintinweb.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}},"created_at":"2013-01-08T21:00:55.000Z","updated_at":"2013-12-14T02:17:47.000Z","dependencies_parsed_at":"2022-09-03T07:51:08.306Z","dependency_job_id":null,"html_url":"https://github.com/tintinweb/LegacyOptparse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tintinweb/LegacyOptparse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FLegacyOptparse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FLegacyOptparse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FLegacyOptparse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FLegacyOptparse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tintinweb","download_url":"https://codeload.github.com/tintinweb/LegacyOptparse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tintinweb%2FLegacyOptparse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34973611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"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":"2024-10-06T16:21:34.739Z","updated_at":"2026-06-30T15:32:07.325Z","avatar_url":"https://github.com/tintinweb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"LegacyOptparse\n==============\n\nSimple to use Optparser with minimal dependencies (getopt,sys,os)\n\n\nFeatures\n--------\n\n* easy to use interface (see example)\n* forced helptext \n* default values for options\n* mandatory options\n\nExample\n--------\n\ncode (see example.py):\n\n\timport SimpleOptparse\n\t\n\tif __name__ == '__main__':\n\t    # define the options we want to catch on the commandline\n\t    # Format:\n\t    #     ((long_option,short_option), a short helpline for this option): default value\n\t    #\n\t    optDef = {  \n\t                (('--help',     '-h')       ,\"This help\"):                                False,\n\t                (('--verbose',  '-v')       ,\"Enable verbose output\"):                    False,\n\t                (('--timeout',  '-t')       ,\"Timeout for the console to stay open\"):         5,\n\t                (('--branch',   '-b')       ,\"use specific branch   \"):                   '1.1',\n\t                (('--magic' ,   '-m')       ,\"insert random magic values here\"):           None,\n\t                (('--deluxe',   '-d')       ,\"Deluxe Option cost more than a million\"):   False,\n\t                (('--cant-afford','-c')     ,\"sure you cant! ha ha ha\"):                  False,    \n\t                (('--manD',     '1')        ,\"This is a mandatory option!\"):              SimpleOptparse.MANDATORY,     \n\t              }\n\t    # do the magic\n\t    options,arguments= SimpleOptparse.parseOpts(optDef)\n\t    # if no option was hit it will print the usage/help \u0026 exit\n\t    # if options were hit, it returns a tuple in the following format:\n\t    #\n\t    # ( {dictionary of all parsed options}, [a list of optional arguments])\n\t    print options\n\t    print arguments\n\n\nrun:\n\n\texample.py\n\noutput:\n\n\tUsage: example.py --manD=\u003cvalue\u003e  [OPTIONS] [Argument(s) ...]\n\t\n\tMandatory arguments to long options are mandatory for short options too.\n\t\n\t  -v,         --verbose                      Enable verbose output.\n\t  -t \u003cvalue\u003e, --timeout=\u003cvalue\u003e              Timeout for the console to stay open.\n\t                                             *** DEFAULT='5'\n\t  -b \u003cvalue\u003e, --branch=\u003cvalue\u003e               use specific branch   .\n\t                                             *** DEFAULT='1.1'\n\t  -c,         --cant-afford                  sure you cant! ha ha ha.\n\t  -h,         --help                         This help.\n\t  -d,         --deluxe                       Deluxe Option cost more than a million.\n\t  1,          --manD                         This is a mandatory option!.\n\t  -m \u003cvalue\u003e, --magic=\u003cvalue\u003e                insert random magic values here.\n\t                                             *** DEFAULT='None'\n\n\n\t\n\n\t\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftintinweb%2Flegacyoptparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftintinweb%2Flegacyoptparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftintinweb%2Flegacyoptparse/lists"}