{"id":14966063,"url":"https://github.com/nxadm/supermain","last_synced_at":"2025-03-03T12:30:41.840Z","repository":{"id":46283819,"uuid":"226288581","full_name":"nxadm/SuperMAIN","owner":"nxadm","description":"Raku MAIN() with superpowers","archived":false,"fork":false,"pushed_at":"2021-11-02T10:04:50.000Z","size":26,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-16T09:51:06.835Z","etag":null,"topics":["cli","command-line","flags","main","parameters","raku"],"latest_commit_sha":null,"homepage":"","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nxadm.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":"2019-12-06T09:07:42.000Z","updated_at":"2024-09-02T06:51:26.000Z","dependencies_parsed_at":"2022-09-10T19:51:01.924Z","dependency_job_id":null,"html_url":"https://github.com/nxadm/SuperMAIN","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2FSuperMAIN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2FSuperMAIN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2FSuperMAIN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nxadm%2FSuperMAIN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nxadm","download_url":"https://codeload.github.com/nxadm/SuperMAIN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241664352,"owners_count":19999473,"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":["cli","command-line","flags","main","parameters","raku"],"created_at":"2024-09-24T13:35:46.481Z","updated_at":"2025-03-03T12:30:41.577Z","avatar_url":"https://github.com/nxadm.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SuperMAIN, Raku MAIN() with superpowers\n\n[![Build Status](https://travis-ci.org/nxadm/SuperMAIN.svg?branch=master)](https://travis-ci.org/nxadm/SuperMAIN)\n\n[MAIN](https://docs.raku.org/language/create-cli#sub_MAIN) is one of the many\nnice features that makes Raku a very fun language to work with. Command Line\nInterfaces (CLI) can be easily be created in a very intuitive way.\n\nThis module adds features to MAIN without changing the syntax (or semantics).\nEverything works as before, just with some nice-to-haves for the users of the\nCLI.\n\n## Features\n\nThe following features were added to MAIN:\n\n- Allow named parameters to be used everywhere instead of only after the \npositional parameters (corresponds with\n`%SUB-MAIN-OPTS\u003cnamed-anywhere\u003e = True`):\n\n```\n$ prog.raku \u003cpositional\u003e [--named1=\u003cStr\u003e] [--named2=\u003cStr\u003e]\n$ prog.raku [--named1=\u003cStr\u003e] [--named2=\u003cStr\u003e] \u003cpositional\u003e\n$ prog.raku [--named1=\u003cStr\u003e] \u003cpositional\u003e [--named2=\u003cStr\u003e] \n```\n\n- Allow spaces as separator between a named parameter and its values (the Raku\ndefault is to only accept '=' as the separator).\n```\n$ prog.raku [--named1=\u003cStr\u003e]\n$ prog.raku [--named1 \u003cStr\u003e] \n```\n\n- Auto-alias named parameters without the need to declare an alias, e.g. to\nmake `-n` an alias of `--named`, you need to declare the alias in the\nsignature:\n\n```raku\nsub MAIN(Str :n(:$named)) { ... }\n```\n\nWith SuperMain, an alias will be automatically created to the shortest *unique*\nparameter identifier, e.g. for the signature\n\n```raku\nsub MAIN(Str :$named, Str :$other-named )) { ... }\n```\n\nthe alias \"-n\" and \"-o\" will be accepted. If MAIN already has an alias for a\nparameter no new alias will be created for that specific parameter.\n\n```\n$ prog.raku [--named=\u003cStr\u003e] [--other-named=\u003cStr\u003e]\n$ prog.raku [-n=\u003cStr\u003e] [-o=\u003cStr\u003e]\n$ prog.raku [--named \u003cStr\u003e] [--other-named \u003cStr\u003e]\n$ prog.raku [-n \u003cStr\u003e] [-o \u003cStr\u003e]\n```\n \n## Usage\n\nAdd this to the script handling the CLI:\n\n```raku\nuse SuperMAIN;\n\n# That's it: just use `sub MAIN` or `multi MAIN` as usual.\n```\n\n## Installation\n\nThrough the ecosystem:\n```\n$ zef install SuperMAIN\n```\n\nLocally:\n\n```\n$ git clone https://github.com/nxadm/SuperMAIN\n$ cd SuperMAIN\n$ zef install .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxadm%2Fsupermain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnxadm%2Fsupermain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnxadm%2Fsupermain/lists"}