{"id":28435672,"url":"https://github.com/JaSei/MooseX-Getopt-Kingpin","last_synced_at":"2025-06-27T22:31:14.645Z","repository":{"id":56830628,"uuid":"95218993","full_name":"JaSei/MooseX-Getopt-Kingpin","owner":"JaSei","description":null,"archived":false,"fork":false,"pushed_at":"2017-06-26T07:42:40.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-06-05T21:07:38.475Z","etag":null,"topics":["getopt","kingpin","module","moose","perl","perl5"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/MooseX::Getopt::Kingpin","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaSei.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2017-06-23T12:39:06.000Z","updated_at":"2019-04-29T08:29:33.000Z","dependencies_parsed_at":"2022-09-09T18:01:19.475Z","dependency_job_id":null,"html_url":"https://github.com/JaSei/MooseX-Getopt-Kingpin","commit_stats":null,"previous_names":["avast/moosex-getopt-kingpin"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/JaSei/MooseX-Getopt-Kingpin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaSei%2FMooseX-Getopt-Kingpin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaSei%2FMooseX-Getopt-Kingpin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaSei%2FMooseX-Getopt-Kingpin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaSei%2FMooseX-Getopt-Kingpin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaSei","download_url":"https://codeload.github.com/JaSei/MooseX-Getopt-Kingpin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaSei%2FMooseX-Getopt-Kingpin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262343694,"owners_count":23296375,"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":["getopt","kingpin","module","moose","perl","perl5"],"created_at":"2025-06-05T21:07:37.350Z","updated_at":"2025-06-27T22:31:14.635Z","avatar_url":"https://github.com/JaSei.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/avast/MooseX-Getopt-Kingpin.svg?branch=master)](https://travis-ci.org/avast/MooseX-Getopt-Kingpin)\n# NAME\n\nMooseX::Getopt::Kingpin - A Moose role for processing command lines options via Getopt::Kingpin\n\n# SYNOPSIS\n\n    ### In your class\n    package MyClass {\n        use Moose;\n        with 'MooseX::Getopt::Kingpin';\n\n        my $lines_default = 10;\n        has 'lines' =\u003e (\n            is            =\u003e 'ro',\n            isa           =\u003e 'Int',\n            default       =\u003e $lines_default,\n            documentation =\u003e sub ($kingpin) {\n                $kingpin-\u003eflag('lines', 'print first N lines')\n                  -\u003edefault($lines_default)\n                  -\u003eshort('n')\n                  -\u003eint();\n            },\n        );\n\n        has 'input_file' =\u003e (\n            is            =\u003e 'ro',\n            isa           =\u003e 'Path::Tiny',\n            required      =\u003e 1,\n            documentation =\u003e sub ($kingpin) {\n                $kingpin-\u003earg('input_file', 'input_file')\n                  -\u003erequired\n                  -\u003eexisting_file();\n            },\n        );\n\n        has 'other_attr' =\u003e (is =\u003e 'ro', isa =\u003e 'Str');\n    };\n\n    my $kingpin = Getopt::Kingpin-\u003enew();\n    my $other_flag = $kingpin-\u003eflag('other_flag', 'this flag do something ...')-\u003ebool();\n    $kingpin-\u003eversion($MyClass::VERSION);\n    MyClass-\u003enew_with_options(\n        $kingpin,\n        other_attr =\u003e 'xxx'\n    );\n\n    if $other_flag {\n        ...\n    }\n\n# DESCRIPTION\n\nThis is a role which provides an alternate constructor for creating objects using parameters passed in from the command line.\n\nThi role use [Getopt::Kingpin](https://metacpan.org/pod/Getopt::Kingpin) as command line processor, MOP and documentation trick.\n\n# METHODS\n\n## new\\_with\\_options($kingpin, %options)\n\n`$kingpin` instance of [Getopt::Kingpin](https://metacpan.org/pod/Getopt::Kingpin) is required\n\n`%options` - classic Moose options, override options set via kingpin\n\n# SEE ALSO\n\n- [MooseX::Getopt](https://metacpan.org/pod/MooseX::Getopt)\n\n# contributing\n\nfor dependency use \\[cpanfile\\](cpanfile)...\n\nfor resolve dependency use \\[carton\\](https://metacpan.org/pod/Carton) (or carton - is more experimental)\n\n    carton install\n\nfor run test use `minil test`\n\n    carton exec minil test\n\nif you don't have perl environment, is best way use docker\n\n    docker run -it -v $PWD:/tmp/work -w /tmp/work avastsoftware/perl-extended carton install\n    docker run -it -v $PWD:/tmp/work -w /tmp/work avastsoftware/perl-extended carton exec minil test\n\n## warning\n\ndocker run default as root, all files which will be make in docker will be have root rights\n\none solution is change rights in docker\n\n    docker run -it -v $PWD:/tmp/work -w /tmp/work avastsoftware/perl-extended bash -c \"carton install; chmod -R 0777 .\"\n\nor after docker command (but you must have root rights)\n\n# LICENSE\n\nCopyright (C) Avast Software.\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# AUTHOR\nJan Seidl \u003cseidl@avast.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaSei%2FMooseX-Getopt-Kingpin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJaSei%2FMooseX-Getopt-Kingpin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJaSei%2FMooseX-Getopt-Kingpin/lists"}