Perinci-CmdLine-1.77/0000755000175000017500000000000013137612066012013 5ustar u1u1Perinci-CmdLine-1.77/README0000644000175000017500000000312313137612066012672 0ustar u1u1NAME Perinci::CmdLine - Rinci/Riap-based command-line application framework VERSION This document describes version 1.77 of Perinci::CmdLine (from Perl distribution Perinci-CmdLine), released on 2017-07-31. DESCRIPTION This module is currently empty, because the implementation is currently split into Perinci::CmdLine::Lite (the lightweight version) and Perinci::CmdLine::Classic (the full but heavier version). There's also Perinci::CmdLine::Any that lets you choose between the two dynamically, à la Any::Moose. And finally there's also Perinci::CmdLine::Inline, the even more lightweight version. This module exists solely for convenience of linking purposes. HOMEPAGE Please visit the project's homepage at . SOURCE Source repository is at . BUGS Please report any bugs or feature requests on the bugtracker website When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. SEE ALSO Perinci::CmdLine::Lite Perinci::CmdLine::Classic Perinci::CmdLine::Any Perinci::CmdLine::Inline AUTHOR perlancar COPYRIGHT AND LICENSE This software is copyright (c) 2017, 2016, 2015 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Perinci-CmdLine-1.77/dist.ini0000644000175000017500000000012213137612066013452 0ustar u1u1version=1.77 name=Perinci-CmdLine [@Author::PERLANCAR] :version=0.58 [Prereqs] Perinci-CmdLine-1.77/Makefile.PL0000644000175000017500000000211313137612066013762 0ustar u1u1# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.008. use strict; use warnings; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Rinci/Riap-based command-line application framework", "AUTHOR" => "perlancar ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Perinci-CmdLine", "LICENSE" => "perl", "NAME" => "Perinci::CmdLine", "PREREQ_PM" => {}, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => 0 }, "VERSION" => "1.77", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Perinci-CmdLine-1.77/META.yml0000644000175000017500000003060213137612066013265 0ustar u1u1--- abstract: 'Rinci/Riap-based command-line application framework' author: - 'perlancar ' build_requires: File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Perinci-CmdLine resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-CmdLine homepage: https://metacpan.org/release/Perinci-CmdLine repository: git://github.com/perlancar/perl-Perinci-CmdLine.git version: '1.77' x_Dist_Zilla: perl: version: '5.024000' plugins: - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . name: '@Author::PERLANCAR/@Filter/GatherDir' version: '6.008' - class: Dist::Zilla::Plugin::PruneCruft name: '@Author::PERLANCAR/@Filter/PruneCruft' version: '6.008' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Author::PERLANCAR/@Filter/ManifestSkip' version: '6.008' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::PERLANCAR/@Filter/MetaYAML' version: '6.008' - class: Dist::Zilla::Plugin::License name: '@Author::PERLANCAR/@Filter/License' version: '6.008' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::PERLANCAR/@Filter/PodCoverageTests' version: '6.008' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::PERLANCAR/@Filter/PodSyntaxTests' version: '6.008' - class: Dist::Zilla::Plugin::ExtraTests name: '@Author::PERLANCAR/@Filter/ExtraTests' version: '6.008' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::PERLANCAR/@Filter/ExecDir' version: '6.008' - class: Dist::Zilla::Plugin::ShareDir name: '@Author::PERLANCAR/@Filter/ShareDir' version: '6.008' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Author::PERLANCAR/@Filter/MakeMaker' version: '6.008' - class: Dist::Zilla::Plugin::Manifest name: '@Author::PERLANCAR/@Filter/Manifest' version: '6.008' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::PERLANCAR/@Filter/ConfirmRelease' version: '6.008' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::PERLANCAR/ExecDir script' version: '6.008' - class: Dist::Zilla::Plugin::PERLANCAR::BeforeBuild name: '@Author::PERLANCAR/PERLANCAR::BeforeBuild' version: '0.58' - class: Dist::Zilla::Plugin::Rinci::AbstractFromMeta name: '@Author::PERLANCAR/Rinci::AbstractFromMeta' version: '0.10' - class: Dist::Zilla::Plugin::PodnameFromFilename name: '@Author::PERLANCAR/PodnameFromFilename' version: '0.02' - class: Dist::Zilla::Plugin::PERLANCAR::EnsurePrereqToSpec name: '@Author::PERLANCAR/PERLANCAR::EnsurePrereqToSpec' version: '0.05' - class: Dist::Zilla::Plugin::PERLANCAR::MetaResources name: '@Author::PERLANCAR/PERLANCAR::MetaResources' version: '0.03' - class: Dist::Zilla::Plugin::CheckChangeLog name: '@Author::PERLANCAR/CheckChangeLog' version: '0.04' - class: Dist::Zilla::Plugin::CheckMetaResources name: '@Author::PERLANCAR/CheckMetaResources' version: '0.001' - class: Dist::Zilla::Plugin::CopyrightYearFromGit name: '@Author::PERLANCAR/CopyrightYearFromGit' version: '0.003' - class: Dist::Zilla::Plugin::IfBuilt name: '@Author::PERLANCAR/IfBuilt' version: '0.03' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::PERLANCAR/MetaJSON' version: '6.008' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::PERLANCAR/MetaConfig' version: '6.008' - class: Dist::Zilla::Plugin::Authority name: '@Author::PERLANCAR/Authority' version: '1.009' - class: Dist::Zilla::Plugin::OurDate name: '@Author::PERLANCAR/OurDate' version: '0.03' - class: Dist::Zilla::Plugin::OurDist name: '@Author::PERLANCAR/OurDist' version: '0.02' - class: Dist::Zilla::Plugin::PERLANCAR::OurPkgVersion name: '@Author::PERLANCAR/PERLANCAR::OurPkgVersion' version: '0.04' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.013' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.013' - class: Pod::Weaver::Section::Name name: '@Author::PERLANCAR/Name' version: '4.013' - class: Pod::Weaver::Section::Version name: '@Author::PERLANCAR/Version' version: '4.013' - class: Pod::Weaver::Section::Region name: '@Author::PERLANCAR/prelude' version: '4.013' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.013' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.013' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.013' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.013' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.013' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.013' - class: Pod::Weaver::Section::Leftovers name: '@Author::PERLANCAR/Leftovers' version: '4.013' - class: Pod::Weaver::Section::Region name: '@Author::PERLANCAR/postlude' version: '4.013' - class: Pod::Weaver::Section::Completion::GetoptLongComplete name: '@Author::PERLANCAR/Completion::GetoptLongComplete' version: '0.08' - class: Pod::Weaver::Section::Completion::GetoptLongSubcommand name: '@Author::PERLANCAR/Completion::GetoptLongSubcommand' version: '0.04' - class: Pod::Weaver::Section::Completion::GetoptLongMore name: '@Author::PERLANCAR/Completion::GetoptLongMore' version: '0.001' - class: Pod::Weaver::Section::Homepage::DefaultCPAN name: '@Author::PERLANCAR/Homepage::DefaultCPAN' version: '0.05' - class: Pod::Weaver::Section::Source::DefaultGitHub name: '@Author::PERLANCAR/Source::DefaultGitHub' version: '0.07' - class: Pod::Weaver::Section::Bugs::DefaultRT name: '@Author::PERLANCAR/Bugs::DefaultRT' version: '0.06' - class: Pod::Weaver::Section::Authors name: '@Author::PERLANCAR/Authors' version: '4.013' - class: Pod::Weaver::Section::Legal name: '@Author::PERLANCAR/Legal' version: '4.013' - class: Pod::Weaver::Plugin::Rinci name: '@Author::PERLANCAR/Rinci' version: '0.77' - class: Pod::Weaver::Plugin::AppendPrepend name: '@Author::PERLANCAR/AppendPrepend' version: '0.01' - class: Pod::Weaver::Plugin::EnsureUniqueSections name: '@Author::PERLANCAR/EnsureUniqueSections' version: '0.121550' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::PERLANCAR/SingleEncoding' version: '4.013' - class: Pod::Weaver::Plugin::PERLANCAR::SortSections name: '@Author::PERLANCAR/PERLANCAR::SortSections' version: '0.06' name: '@Author::PERLANCAR/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::PruneFiles name: '@Author::PERLANCAR/PruneFiles' version: '6.008' - class: Dist::Zilla::Plugin::Pod2Readme name: '@Author::PERLANCAR/Pod2Readme' version: '0.004' - class: Dist::Zilla::Plugin::Rinci::AddPrereqs name: '@Author::PERLANCAR/Rinci::AddPrereqs' version: '0.13' - class: Dist::Zilla::Plugin::Rinci::AddToDb name: '@Author::PERLANCAR/Rinci::AddToDb' version: '0.01' - class: Dist::Zilla::Plugin::Rinci::Validate name: '@Author::PERLANCAR/Rinci::Validate' version: '0.24' - class: Dist::Zilla::Plugin::SetScriptShebang name: '@Author::PERLANCAR/SetScriptShebang' version: '0.01' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: test script_finder: - ':PerlExecFiles' skips: [] name: '@Author::PERLANCAR/Test::Compile' version: '2.054' - class: Dist::Zilla::Plugin::Test::Rinci name: '@Author::PERLANCAR/Test::Rinci' version: '0.03' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 0 mode: on name: '@Author::PERLANCAR/StaticInstall' version: '0.010' - class: Dist::Zilla::Plugin::EnsureSQLSchemaVersionedTest name: '@Author::PERLANCAR/EnsureSQLSchemaVersionedTest' version: '0.03' - class: Dist::Zilla::Plugin::Acme::CPANLists::Blacklist name: '@Author::PERLANCAR/Acme::CPANLists::Blacklist' version: '0.04' - class: Dist::Zilla::Plugin::Prereqs::EnsureVersion name: '@Author::PERLANCAR/Prereqs::EnsureVersion' version: '0.04' - class: Dist::Zilla::Plugin::Prereqs::CheckCircular name: '@Author::PERLANCAR/Prereqs::CheckCircular' version: '0.005' - class: Dist::Zilla::Plugin::UploadToCPAN::WWWPAUSESimple name: '@Author::PERLANCAR/UploadToCPAN::WWWPAUSESimple' version: '0.04' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.008' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.008' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.008' x_authority: cpan:PERLANCAR x_serialization_backend: 'YAML::Tiny version 1.69' x_static_install: 1 Perinci-CmdLine-1.77/t/0000755000175000017500000000000013137612066012256 5ustar u1u1Perinci-CmdLine-1.77/t/author-pod-syntax.t0000644000175000017500000000045413137612066016054 0ustar u1u1#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Perinci-CmdLine-1.77/t/00-compile.t0000644000175000017500000000233413137612066014312 0ustar u1u1use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Perinci/CmdLine.pm' ); # no fake home requested my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; Perinci-CmdLine-1.77/t/author-pod-coverage.t0000644000175000017500000000053613137612066016322 0ustar u1u1#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Perinci-CmdLine-1.77/weaver.ini0000644000175000017500000000002513137612066014002 0ustar u1u1[@Author::PERLANCAR] Perinci-CmdLine-1.77/META.json0000644000175000017500000004467013137612066013447 0ustar u1u1{ "abstract" : "Rinci/Riap-based command-line application framework", "author" : [ "perlancar " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Perinci-CmdLine", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::More" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-CmdLine" }, "homepage" : "https://metacpan.org/release/Perinci-CmdLine", "repository" : { "type" : "git", "url" : "git://github.com/perlancar/perl-Perinci-CmdLine.git", "web" : "https://github.com/perlancar/perl-Perinci-CmdLine" } }, "version" : "1.77", "x_Dist_Zilla" : { "perl" : { "version" : "5.024000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "@Author::PERLANCAR/@Filter/GatherDir", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Author::PERLANCAR/@Filter/PruneCruft", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Author::PERLANCAR/@Filter/ManifestSkip", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::PERLANCAR/@Filter/MetaYAML", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::PERLANCAR/@Filter/License", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::PERLANCAR/@Filter/PodCoverageTests", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::PERLANCAR/@Filter/PodSyntaxTests", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@Author::PERLANCAR/@Filter/ExtraTests", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::PERLANCAR/@Filter/ExecDir", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Author::PERLANCAR/@Filter/ShareDir", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Author::PERLANCAR/@Filter/MakeMaker", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::PERLANCAR/@Filter/Manifest", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::PERLANCAR/@Filter/ConfirmRelease", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::PERLANCAR/ExecDir script", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::BeforeBuild", "name" : "@Author::PERLANCAR/PERLANCAR::BeforeBuild", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::Rinci::AbstractFromMeta", "name" : "@Author::PERLANCAR/Rinci::AbstractFromMeta", "version" : "0.10" }, { "class" : "Dist::Zilla::Plugin::PodnameFromFilename", "name" : "@Author::PERLANCAR/PodnameFromFilename", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::EnsurePrereqToSpec", "name" : "@Author::PERLANCAR/PERLANCAR::EnsurePrereqToSpec", "version" : "0.05" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::MetaResources", "name" : "@Author::PERLANCAR/PERLANCAR::MetaResources", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::CheckChangeLog", "name" : "@Author::PERLANCAR/CheckChangeLog", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::CheckMetaResources", "name" : "@Author::PERLANCAR/CheckMetaResources", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CopyrightYearFromGit", "name" : "@Author::PERLANCAR/CopyrightYearFromGit", "version" : "0.003" }, { "class" : "Dist::Zilla::Plugin::IfBuilt", "name" : "@Author::PERLANCAR/IfBuilt", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::PERLANCAR/MetaJSON", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::PERLANCAR/MetaConfig", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::PERLANCAR/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::OurDate", "name" : "@Author::PERLANCAR/OurDate", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::OurDist", "name" : "@Author::PERLANCAR/OurDist", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::OurPkgVersion", "name" : "@Author::PERLANCAR/PERLANCAR::OurPkgVersion", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.013" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::PERLANCAR/Name", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::PERLANCAR/Version", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::PERLANCAR/prelude", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::PERLANCAR/Leftovers", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::PERLANCAR/postlude", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongComplete", "name" : "@Author::PERLANCAR/Completion::GetoptLongComplete", "version" : "0.08" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongSubcommand", "name" : "@Author::PERLANCAR/Completion::GetoptLongSubcommand", "version" : "0.04" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongMore", "name" : "@Author::PERLANCAR/Completion::GetoptLongMore", "version" : "0.001" }, { "class" : "Pod::Weaver::Section::Homepage::DefaultCPAN", "name" : "@Author::PERLANCAR/Homepage::DefaultCPAN", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Source::DefaultGitHub", "name" : "@Author::PERLANCAR/Source::DefaultGitHub", "version" : "0.07" }, { "class" : "Pod::Weaver::Section::Bugs::DefaultRT", "name" : "@Author::PERLANCAR/Bugs::DefaultRT", "version" : "0.06" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::PERLANCAR/Authors", "version" : "4.013" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::PERLANCAR/Legal", "version" : "4.013" }, { "class" : "Pod::Weaver::Plugin::Rinci", "name" : "@Author::PERLANCAR/Rinci", "version" : "0.77" }, { "class" : "Pod::Weaver::Plugin::AppendPrepend", "name" : "@Author::PERLANCAR/AppendPrepend", "version" : "0.01" }, { "class" : "Pod::Weaver::Plugin::EnsureUniqueSections", "name" : "@Author::PERLANCAR/EnsureUniqueSections", "version" : "0.121550" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::PERLANCAR/SingleEncoding", "version" : "4.013" }, { "class" : "Pod::Weaver::Plugin::PERLANCAR::SortSections", "name" : "@Author::PERLANCAR/PERLANCAR::SortSections", "version" : "0.06" } ] } }, "name" : "@Author::PERLANCAR/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::PruneFiles", "name" : "@Author::PERLANCAR/PruneFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::Pod2Readme", "name" : "@Author::PERLANCAR/Pod2Readme", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::Rinci::AddPrereqs", "name" : "@Author::PERLANCAR/Rinci::AddPrereqs", "version" : "0.13" }, { "class" : "Dist::Zilla::Plugin::Rinci::AddToDb", "name" : "@Author::PERLANCAR/Rinci::AddToDb", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::Rinci::Validate", "name" : "@Author::PERLANCAR/Rinci::Validate", "version" : "0.24" }, { "class" : "Dist::Zilla::Plugin::SetScriptShebang", "name" : "@Author::PERLANCAR/SetScriptShebang", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 0, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [] } }, "name" : "@Author::PERLANCAR/Test::Compile", "version" : "2.054" }, { "class" : "Dist::Zilla::Plugin::Test::Rinci", "name" : "@Author::PERLANCAR/Test::Rinci", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 0, "mode" : "on" } }, "name" : "@Author::PERLANCAR/StaticInstall", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::EnsureSQLSchemaVersionedTest", "name" : "@Author::PERLANCAR/EnsureSQLSchemaVersionedTest", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::Acme::CPANLists::Blacklist", "name" : "@Author::PERLANCAR/Acme::CPANLists::Blacklist", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::Prereqs::EnsureVersion", "name" : "@Author::PERLANCAR/Prereqs::EnsureVersion", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::Prereqs::CheckCircular", "name" : "@Author::PERLANCAR/Prereqs::CheckCircular", "version" : "0.005" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN::WWWPAUSESimple", "name" : "@Author::PERLANCAR/UploadToCPAN::WWWPAUSESimple", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.008" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.008" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.008" } }, "x_authority" : "cpan:PERLANCAR", "x_serialization_backend" : "Cpanel::JSON::XS version 3.0217", "x_static_install" : 1 } Perinci-CmdLine-1.77/MANIFEST0000644000175000017500000000054213137612066013145 0ustar u1u1# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.008. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Perinci/CmdLine.pm lib/Perinci/CmdLine/Manual.pod lib/Perinci/CmdLine/Manual/Examples.pod lib/Perinci/CmdLine/Manual/FAQ.pod t/00-compile.t t/author-pod-coverage.t t/author-pod-syntax.t weaver.ini Perinci-CmdLine-1.77/lib/0000755000175000017500000000000013137612066012561 5ustar u1u1Perinci-CmdLine-1.77/lib/Perinci/0000755000175000017500000000000013137612066014152 5ustar u1u1Perinci-CmdLine-1.77/lib/Perinci/CmdLine/0000755000175000017500000000000013137612066015465 5ustar u1u1Perinci-CmdLine-1.77/lib/Perinci/CmdLine/Manual.pod0000644000175000017500000003102313137612066017405 0ustar u1u1package Perinci::CmdLine::Manual; # just to make podweaver happy # DATE # VERSION 1; # ABSTRACT: Perinci::CmdLine manual __END__ =pod =encoding UTF-8 =head1 NAME Perinci::CmdLine::Manual - Perinci::CmdLine manual =head1 VERSION This document describes version 1.77 of Perinci::CmdLine::Manual (from Perl distribution Perinci-CmdLine), released on 2017-07-31. =head1 DESCRIPTION Perinci::CmdLine is a command-line application framework. It parses command-line options and dispatches to one of your specified Perl functions, passing the command-line options and arguments to the function. It accesses functions via L protocol (using the L Riap client library) so you can use remote functions transparently. Features: =over 4 =item * Command-line options parsing Non-scalar arguments (array, hash, other nested) can also be passed as JSON or YAML. For example, if the C argument is defined as 'array', then all of below are equivalent: % mycmd --tags-yaml '[foo, bar, baz]' % mycmd --tags-json '["foo","bar","baz"]' % mycmd --tags foo --tags bar --tags baz =item * Help message (utilizing information from metadata, supports translation) % mycmd --help % mycmd -h % mycmd -? =item * Tab completion for various shells (including completion from remote code) Example for bash: % complete -C mycmd mycmd % mycmd --he ; # --help % mycmd s ; # sub1, sub2, sub3 (if those are the specified subcommands) % mycmd sub1 - ; # list the options available for sub1 subcommand =item * Undo/redo/history If the function supports transaction (see L, L) the framework will setup transaction and provide command to do undo (--undo) and redo (--redo) as well as seeing the undo/transaction list (--history) and clearing the list (--clear-history). =item * Version (--version, -v) =item * List available subcommands (--subcommands) =item * Configurable output format (--format, --format-options) By default C, C, C, C, C are recognized. =back =head1 CONCEPTS Perinci::CmdLine is very function-oriented (and very not object-oriented, on purpose). You write your "business logic" in a function (of course, you are free to subdivide or delegate to other functions, but there must be one main function for a single-subcommand CLI application, or one function for each subcommand in a multiple-subcommand CLI application. sub cliapp { ... } You annotate the function with L metadata, where you describe what arguments (and command-line aliases, if any) the function (program) accepts, the summary and description of those arguments, and several other aspects as necessary. $SPEC{cliapp} = { v => 1.1, summary => 'A program to do blah blah', args => { foo => { summary => 'foo argument', req => 1, pos => 0, cmdline_aliases => {f=>{}}, }, bar => { ... }, }, }; sub cliapp { ... } Finally, you "run" your function: use Perinci::CmdLine::Any; Perinci::CmdLine::Any->new(url => '/main/cliapp')->run; For a multi-subcommand application: Perinci::CmdLine::Any->new( url => '/main/cliapp', subcommands => { sc1 => { url => '/main/do_sc1' }, sc2 => { url => '/main/do_sc2' }, ... }, )->run; That's it. Command-line option parsing, help message, as well as tab completion will work without extra effort. To run a remote function, you can simply specify a remote URL, e.g. C. All the features like options parsing, help/usage, as well as tab completion will work with remote functions as well. =head1 DISPATCHING Below is the description of how the framework determines what action and which function to call. TODO =head1 LOGGING Logging is done with L (for producing). For displaying logs, L is used. Initializing logging adds a bit to startup overhead time, so the framework defaults to no logging. To turn on logging from the code, set the C attribute to true when constructing Perinci::CmdLine object. Or, use something like: % PERL5OPT=-MLog::ger::App TRACE=1 yourcli.pl =head1 [Classic] UTF8 OUTPUT By default, C<< binmode(STDOUT, ":utf8") >> is issued if utf8 output is desired. This is determined by, in order: =over =item * Use setting from environment UTF8, if defined. This allows you to force-disable or force-enable utf8 output. =item * Use setting from action metadata, if defined. Some actions like L, L, and L output translated text, so they have their C metadata set to 1. =item * Use setting from subcommand, if defined. =item * Use setting from C attribute. This attribute comes from L, its default is determined from L environment as well as terminal's capabilities. =back =head1 [Classic] COLOR THEMES By default colors are used, but if terminal is detected as not having color support, they are turned off. You can also turn off colors by setting COLOR=0 or using PERINCI_CMDLINE_COLOR_THEME=Default::no_color. =head1 COMMAND-LINE OPTION/ARGUMENT PARSING This section describes how Perinci::CmdLine parses command-line options/arguments into function arguments. Command-line option parsing is implemented by L. For boolean function arguments, use C<--arg> to set C to true (1), and C<--noarg> to set C to false (0). A flag argument (C<< [bool => {is=>1}] >>) only recognizes C<--arg> and not C<--noarg>. For single letter arguments, only C<-X> is recognized, not C<--X> nor C<--noX>. For string and number function arguments, use C<--arg VALUE> or C<--arg=VALUE> (or C<-X VALUE> for single letter arguments) to set argument value. Other scalar arguments use the same way, except that some parsing will be done (e.g. for date type, --arg 1343920342 or --arg '2012-07-31' can be used to set a date value, which will be a DateTime object.) (Note that date parsing will be done by L and currently not implemented yet.) For arguments with type array of scalar, a series of C<--arg VALUE> is accepted, a la L: --tags tag1 --tags tag2 ; # will result in tags => ['tag1', 'tag2'] For other non-scalar arguments, also use C<--arg VALUE> or C<--arg=VALUE>, but VALUE will be attempted to be parsed using JSON, and then YAML. This is convenient for common cases: --aoa '[[1],[2],[3]]' # parsed as JSON --hash '{a: 1, b: 2}' # parsed as YAML For explicit JSON parsing, all arguments can also be set via --ARG-json. This can be used to input undefined value in scalars, or setting array value without using repetitive C<--arg VALUE>: --str-json 'null' # set undef value --ary-json '[1,2,3]' # set array value without doing --ary 1 --ary 2 --ary 3 --ary-json '[]' # set empty array value Likewise for explicit YAML parsing: --str-yaml '~' # set undef value --ary-yaml '[a, b]' # set array value without doing --ary a --ary b --ary-yaml '[]' # set empty array value B. Arguments from submetadata will also be given respective command-line options (and aliases) with prefixed names. For example this function metadata: { v => 1.1, args => { foo => {schema=>'str*'}, bar => { schema => 'hash*', meta => { v => 1.1, args => { baz => {schema=>'str*'}, qux => { schema=>'str*, }, }, }, }, quux => { schema => 'array*', element_meta => { v => 1.1, args => { corge => {schema=>'str*', cmdline_aliases=>{C=>{}}, grault => {schema=>'str*'}, }, }, }, }, } You can specify on the command-line: % prog --foo val \ --bar-baz val --bar-qux val \ --quux-corge 11 \ --quux-corge 21 --quux-grault 22 \ --quux-C 31 The resulting argument will be: { foo => 'val', bar => { baz => 'val', qux => 'val', }, quux => [ {corge=>11}, {corge=>21, grault=>22}, {corge=>31}, ], } For more examples on argument submetadata, see L. =head1 SHELL COMPLETION The framework can detect when C and C environment variables (set by bash when completing using external command) are set and then answer the completion. In bash, activating tab completion for your script is as easy as (assuming your script is already in PATH): % complete -C yourscript yourscript That is, your script can complete itself. The above command can be put in C<~/.bashrc>. But it is recommended that you use L instead (see below). Tcsh uses C instead. The framework can also detect that. For other shells: some shells can emulate bash (like zsh) and for some other (like fish) you need to generate a set of C commands for each command-line option. C is a CLI tool that can detect all scripts in PATH if they are using Perinci::CmdLine (as well as a few other frameworks) and generate shell completion scripts for them. It supports several shells. Combined with L, you can install modules and have the shell completion of scripts activated immediately. =head1 PROGRESS INDICATOR For functions that express that they do progress updating (by setting their C feature to true), Perinci::CmdLine will setup an output, currently either L if program runs interactively, or L if program doesn't run interactively. =head1 CONFIGURATION FILE Configuration files are read to preset the value of arguments, before potentially overridden/merged with command-line options. Configuration files are in L format, which is basically C with some extra features. By default, configuration files are searched in C and home directory, with the name of I + C<.conf>. If multiple files are found, the contents are merged together. If user wants to use a custom configuration file, she can issue C<--config-path> command-line option. If user does not want to read configuration file, she can issue C<--no-config> command-line option. INI files have the concept of "sections". In Perinci::CmdLine, you can use sections to put settings that will only be applied to a certain subcommand, or a certain "profile". "Config profiles" is a way to specify multiple sets/cases/scenarios in a single configuration file. Example 1 (without any profile or subcommand): ; prog.conf foo=1 bar=2 When executing program (the comments will show what arguments are set): % prog; # {foo=>1, bar=>2} % prog --foo 10; # {foo=>10, bar=>2} Example 2 (with profiles): ; prog.conf [profile=profile1] foo=1 bar=2 [profile=profile2] foo=10 bar=20 When executing program: % prog; # {} % prog --config-profile profile1; # {foo=>1, bar=>2} % prog --config-profile profile2; # {foo=>10, bar=>20} Example 3 (with subcommands): ; prog.conf [subcommand=sc1] foo=1 bar=2 [subcommand=sc2] baz=3 qux=4 When executing program: % prog sc1; # {foo=>1, bar=>2} % prog sc2; # {baz=>3, qux=>4} Example 4 (with subcommands and profiles): ; prog.conf [subcommand=sc1 profile=profile1] foo=1 bar=2 [profile=profile2 subcommand=sc1] foo=10 bar=20 When executing program: % prog sc1 --config-profile profile1; # {foo=>1, bar=>2} % prog sc1 --config-profile profile2; # {foo=>10, bar=>20} =head1 HOMEPAGE Please visit the project's homepage at L. =head1 SOURCE Source repository is at L. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 SEE ALSO L L A list of tutorial posts on my blog, will eventually be moved to POD: L =head1 AUTHOR perlancar =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017, 2016, 2015 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Perinci-CmdLine-1.77/lib/Perinci/CmdLine/Manual/0000755000175000017500000000000013137612066016702 5ustar u1u1Perinci-CmdLine-1.77/lib/Perinci/CmdLine/Manual/Examples.pod0000644000175000017500000005562713137612066021203 0ustar u1u1package Perinci::CmdLine::Manual::Examples; # just to make podweaver happy # DATE # VERSION 1; # ABSTRACT: Collection of examples __END__ =pod =encoding UTF-8 =head1 NAME Perinci::CmdLine::Manual::Examples - Collection of examples =head1 VERSION This document describes version 1.77 of Perinci::CmdLine::Manual::Examples (from Perl distribution Perinci-CmdLine), released on 2017-07-31. =head1 DESCRIPTION In the examples, L is used to show examples that are applicable to either L or L. For examples that are more appropriate or only applicable to specific implementation, the specific module will be used. Perinci::CmdLine::Classic is hereby referred to as C, while Perinci::CmdLine as C. =head1 BASICS =head2 Simplest application Since Perinci::CmdLine is function- and metadata-based, you need to create at least one function and add some metadata for it. And you'll need to return the result as an enveloped response. The simplest is something like: #!perl use strict; use warnings; use Perinci::CmdLine::Any; our %SPEC; $SPEC{hello} = { v => 1.1, summary => 'Say hello', }; sub hello { [200, "OK", "Hello, world!"]; } Perinci::CmdLine::Any->new(url => '/main/hello')->run; The C attribute specifies the location of the function in URL format (see L for more details on the syntax of URL). It is basically a fully-qualified function name, with C<::> replaced with C. With this URL-based syntax, it is possible to use a remote and/or non-Perl function for the CLI application. The hash in C<$SPEC{hello}> is called a L metadata. The keys are called properties. There are two properties: C (which is always required with the value of 1.1 to specify version) and C (which is actually optional, to describe the function). In this example, the function and its metadata is put inside the same script. You can of course put them in a separate Perl module, and use them with e.g. C<< url => '/Your/Module/func' >>. It is also worth mentioning that if you use the Perinci::CmdLine framework, your functions can also be used directly by other Perl modules/code since they are just regular Perl functions. The function returns a 3-element array containing HTTP-like status code, a status message, and the actual result. If you save the above script as C run it on the command-line: % ./hello Hello, world! Yup, not very interesting. You get help message for free: % ./hello --help % ./hello -h As well as some common options like C<--format> to return the result in a different format: % ./hello --json [200,"OK","Hello, world!"] % ./hello --format perl; # only in PC::Classic, not available in PC::Lite [200, "OK", "Hello, world!"] =head1 FUNCTION ARGUMENTS AND COMMAND-LINE OPTIONS =head2 Basics Function arguments map to command-line options. Example: #!perl use strict; use warnings; use Perinci::CmdLine::Any; our %SPEC; $SPEC{hello} = { v => 1.1, summary => 'Say hello', args => { name => { summary => 'Name to say hello to', }, }, }; sub hello { my %args = @_; [200, "OK", "Hello, $args{name}!"]; } Perinci::CmdLine::Any->new(url => '/main/hello')->run; When you run this: % ./hello --name Jimmy Hello, Jimmy! If you run C<./hello --help>, the option is now mentioned as well in the help message. Unknown arguments will result in an error: % ./hello --gender m ERROR 400: Unknown option '--gender' To specify that an argument is required, add C property to the argument specification with a true value: args => { name => { summary => 'Name to say hello to', req => 1, }, }, So when you run the app: % ./hello ERROR 400: Missing required argument 'name' To specify that an argument can also be specified via positional command-line I instead of just command-line I