Code Monkey home page Code Monkey logo

moosex-app's People

Contributors

andrewrjones avatar astoddard avatar bmwiedemann avatar caldrin avatar doherty avatar domm avatar ebaudrez avatar jrmash avatar lharey avatar m0ses avatar maros avatar mcsnolte avatar perlpunk avatar ppisar avatar pplu avatar sergeyromanov avatar sirhalos avatar xdg avatar xsawyerx avatar yanick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

moosex-app's Issues

Please put the $VERSION in all packages

This makes various types of tooling happier. In my case it's some internal tooling that ensures that every package we use in our code base is listed in our cpanfile.

Lots of POD formatting is lost

Thank you for this module. So far it is the best I've seen for this purpose. I'll be using it.

I've noticed that when I write POD for documentation, a lot of the formatting is lost. It is especially painful that all =head2 Heading String lines seem not to be shown at all. That is a shame, because what makes MooseX-App stand out is its ability to use POD for documentation strings to create rich documentation and it would be nice if one could use all of POD for creating documentation.

Is there anything I can do?

Pod in MyApp::Foo:

=head1 NAME

foo - do something wonderful

=head1 USAGE

Usage for foo

With additional B<bold> I<italic> and C<code> text

=head1 DESCRIPTION

Foo description

    With B<bold> that should be rendered as-is because of indentation

=head2 Subheading 2

Text for subheading 2

There are these things to consider:

=over 4

=item temperature

Temperature

=item price of pigs in New Zealand

I'm sure that matters too, somehow

=back

=cut

This is what it looks like with perldoc:

perldoc

And this is what it looks like with ./mooseapp.pl foo --help:

usage

Note especially how the "Subheading 2" string is simply omitted altogether

pod2text MyApp/Foo.pm shows this which is already much better:

NAME
    foo - do something wonderful

USAGE
    Usage for foo

    With additional bold *italic* and "code" text

DESCRIPTION
    Foo description

        With B<bold> that should be rendered as-is because of indentation

  Subheading 2
    Text for subheading 2

    There are these things to consider:

    temperature
        Temperature

    price of pigs in New Zealand
        I'm sure that matters too, somehow

I tried it with versions 1.22 from debians stable repository and 1.37 from CPAN.

Dependency on List::Util v1.44

It seems that MX::App may depend on List::Util v1.44 (when the 'uniq' function was added), but does not explicitly declare it so:

Failed test 'use MooseX::App;'
at t/00_load.t line 7.
Tried to use 'MooseX::App'.
Error: "uniq" is not exported by the List::Util module

I ran into that error on a machine that had List::Util v1.38 installed.

Tests fail with Perl 5.37.10

Tests are failing since Perl 5.37.10.

If you want to see complete log please check CPAN Testers.

Example from log:

given is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 572.
when is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 573.
when is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 576.
Smartmatch is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Meta/Role/Class/Base.pm line 741.

#   Failed test 'no warnings'
#   at /usr/share/perl5/Test/Builder.pm line 193.
# There were 24 warning(s)
#     Previous test 0 ''
#     given is deprecated at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Utils.pm line 237.
#  at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Utils.pm line 237.
# 	require MooseX/App/Utils.pm called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
# 	MooseX::App::Exporter::BEGIN() called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
# 	eval {...} called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App/Exporter.pm line 11
# 	require MooseX/App/Exporter.pm called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
# 	MooseX::App::BEGIN() called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
# 	eval {...} called at /builddir/build/BUILD/MooseX-App-1.42/blib/lib/MooseX/App.pm line 14
# 	require MooseX/App.pm called at t/testlib/Test01.pm line 4
# 	Test01::BEGIN() called at t/testlib/Test01.pm line 4
# 	eval {...} called at t/testlib/Test01.pm line 4
# 	require Test01.pm called at t/01_basic.t line 11
# 	main::BEGIN() called at t/01_basic.t line 11
# 	eval {...} called at t/01_basic.t line 11
# 
# ----------

Boolean options are capturing parameters

Me again. :-)

Just so that you know, another issue with the argument parsing is that ParseArgv does not know if an option is a boolean, and so will always slurp the following parameter. For example:

foo bar --myflag myarg

will try to stuff myarg in the myflag option.

I must say, with the current disassociated way that the arguments are parsed, I don't see an easy way out of that one. :-7

Color Plugin on Win32

When using this module with the 'Color' plugin on Win32, the messages are printed with the ANSI escape sequences, but are not colorized.

It is likely necessary to require 'Win32::Console::ANSI' to properly display colors on Win32 platforms.

Ability to turn off boolean negation added in 1.36

We have a lot of boolean options in our codebase like '--no-db' that after upgrading to 1.36 are now broken, as when --no-db is specified on the command line it tries to update the --db option, which doesn't exist, so our code no longer works.

I would rather be able to say if ( $self->no_db ) as it is more readable the way we use it (we never check if it is false). Would it be possible to add an app setting like app_permute? Or a check to see if the no_ option exists and use it instead, so it is backwards compatible?

Task: Alias command names

Add ability to create aliases for commands. Make sure that all plugings (typo, bashcomplete, man, ...) handle aliases

libmoosex-app-perl: FTBFS: dh_auto_test: error: make -j4 test TEST_VERBOSE=1 returned exit code 2

We have the following bug reported to the Debian package of
MooseX-App, c.f. https://bugs.debian.org/978302

It doesn't seem to be a bug in the packaging, so you may want to take
a look. Thanks!

This test failure is quite new, my guess is that it might be related to the
recent update of Moose to 2.2014.

------8<-----------8<-----------8<-----------8<-----------8<-----

Source: libmoosex-app-perl
Version: 1.41-1
Severity: serious
Justification: FTBFS on amd64
Tags: bullseye sid ftbfs
Usertags: ftbfs-20201226 ftbfs-bullseye

Hi,

During a rebuild of all packages in sid, your package failed to build
on amd64.

Relevant part (hopefully):
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(1, 'blib/lib', 'blib/arch')" t/*.t
> t/00_load.t ............... 
> 1..43
> ok 1 - use MooseX::App;
> ok 2 - use MooseX::App::ParsedArgv;
> ok 3 - use MooseX::App::Command;
> ok 4 - use MooseX::App::Utils;
> ok 5 - use MooseX::App::Message::Block;
> ok 6 - use MooseX::App::Message::Envelope;
> ok 7 - use MooseX::App::Meta::Role::Attribute::Option;
> ok 8 - use MooseX::App::Meta::Role::Class::Base;
> ok 9 - use MooseX::App::Meta::Role::Class::Command;
> ok 10 - use MooseX::App::Meta::Role::Class::Simple;
> ok 11 - use MooseX::App::Meta::Role::Class::Documentation;
> ok 12 - use MooseX::App::Plugin::BashCompletion;
> ok 13 - use MooseX::App::Plugin::BashCompletion::Command;
> ok 14 - use MooseX::App::Plugin::BashCompletion::Meta::Class;
> ok 15 - use MooseX::App::Plugin::Config;
> ok 16 - use MooseX::App::Plugin::Config::Meta::Class;
> ok 17 - use MooseX::App::Plugin::Version;
> ok 18 - use MooseX::App::Plugin::Version::Command;
> ok 19 - use MooseX::App::Plugin::Version::Meta::Class;
> ok 20 - use MooseX::App::Plugin::Man;
> ok 21 - use MooseX::App::Plugin::Man::Command;
> ok 22 - use MooseX::App::Plugin::Man::Meta::Class;
> ok 23 - use MooseX::App::Plugin::Depends;
> ok 24 - use MooseX::App::Plugin::Depends::Meta::Attribute;
> ok 25 - use MooseX::App::Plugin::Depends::Meta::Class;
> ok 26 - use MooseX::App::Plugin::MutexGroup;
> ok 27 - use MooseX::App::Plugin::MutexGroup::Meta::Attribute;
> ok 28 - use MooseX::App::Plugin::MutexGroup::Meta::Class;
> ok 29 - use MooseX::App::Utils;
> ok 30 - use MooseX::App::Simple;
> ok 31 - use MooseX::App::Exporter;
> ok 32 - use MooseX::App::Role::Base;
> ok 33 - use MooseX::App::Role::Common;
> ok 34 - use MooseX::App::Plugin::Term;
> ok 35 - use MooseX::App::Plugin::Term::Meta::Class;
> ok 36 - use MooseX::App::Plugin::Term::Meta::Attribute;
> ok 37 - use MooseX::App::Plugin::Color;
> ok 38 - use MooseX::App::Message::BlockColor;
> ok 39 - use MooseX::App::Plugin::Color::Meta::Class;
> ok 40 - use MooseX::App::Plugin::ConfigHome;
> ok 41 - use MooseX::App::Plugin::ConfigHome::Meta::Class;
> ok 42 # skip Text::WagnerFischer is not installed
> ok 43 # skip Text::WagnerFischer is not installed
> ok
> t/01_basic.t .............. 
> 1..13
> # Subtest: Excact command with option
>     ok 1 - An object of class 'Test01::CommandA' isa 'Test01::CommandA'
>     ok 2 - Param is set
>     1..2
> ok 1 - Excact command with option
> # Subtest: Fuzzy command with option
>     ok 1 - An object of class 'Test01::CommandA' isa 'Test01::CommandA'
>     ok 2 - Param is set
>     1..2
> ok 2 - Fuzzy command with option
> # Subtest: Wrong command
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message is set
>     ok 3 - Message is of type error
>     ok 4 - Usage set
>     ok 5 - Usage body set
>     ok 6 - Global options set
>     ok 7 - Global options body set
>     ok 8 - Available commands set
>     ok 9 - Available commands body set
>     1..9
> ok 3 - Wrong command
> # Subtest: Help for command
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Usage is set
>     ok 3 - Usage body set
>     ok 4 - Description is set
>     ok 5 - Description body set
>     ok 6 - Options header is set
>     ok 7 - Options body is set
>     1..7
> ok 4 - Help for command
> # Subtest: With extra args
>     ok 1 - An object of class 'Test01::CommandB' isa 'Test01::CommandB'
>     ok 2 - Param global is set
>     ok 3 - Param param_b is set
>     ok 4 - Param private is set
>     1..4
> ok 5 - With extra args
> # Subtest: Wrapper script
>     ok 1 - Output is ok
>     1..1
> ok 6 - Wrapper script
> # Subtest: Custom help text
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Usage is set
>     ok 3 - Usage is ok
>     ok 4 - description is set
>     ok 5 - Description is ok
>     1..5
> ok 7 - Custom help text
> # Subtest: Input errors missing
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Error message ok
>     1..2
> ok 8 - Input errors missing
> # Subtest: Input errors type
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Error message ok
>     ok 3 - Error message ok
>     1..3
> ok 9 - Input errors type
> # Subtest: Global help requested
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Help message ok
>     1..2
> ok 10 - Global help requested
> # Subtest: Missing command
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Error message ok
>     1..2
> ok 11 - Missing command
> # Subtest: Extra params
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Error message ok
>     1..2
> ok 12 - Extra params
> ok 13 - no warnings
> ok
> t/02_meta.t ............... 
> 1..29
> ok 1 - Commands found
> ok 2 - Commands found
> ok 3 - Command namespace ok
> ok 4 - Command base ok
> ok 5 - Message class
> ok 6 - Role applied to base class
> ok 7 - Role applied to base class
> ok 8 - Found three commands
> ok 9 - Command A found
> ok 10 - Command A matched
> ok 11 - Command A,B,C1 and D matched
> ok 12 - Command C1 matched fuzzy
> ok 13 - Command C1 matched exactly
> ok 14 - Has three attributes
> ok 15 - Usage name ok
> ok 16 - Usage description ok
> ok 17 - Usage name ok
> ok 18 - Usage name ok
> ok 19 - Usage description ok
> ok 20 - Tags ok
> ok 21 - Changed tags ok
> ok 22 - An object of class 'MooseX::App::Message::Block' isa 'MooseX::App::Message::Block'
> ok 23 - Description body ok
> ok 24 - Pod short description parsed ok
> ok 25 - Pod long description parsed ok
> ok 26 - Command usage parsed ok
> ok 27 - Attribute name ok
> ok 28 - Check attributes tags
> ok 29 - no warnings
> ok
> t/03_utils.t .............. 
> 1..5
> # Subtest: Class to command
>     ok 1 - Command ok
>     ok 2 - Command ok
>     ok 3 - Command ok
>     ok 4 - Command ok
>     ok 5 - Command ok
>     1..5
> ok 1 - Class to command
> # Subtest: Format text
>     ok 1 - Format text ok
>     ok 2 - Format text ok
>     ok 3 - Format text ok
>     1..3
> ok 2 - Format text
> # Subtest: Formater
>     ok 1 - Format list ok
>     1..1
> ok 3 - Formater
> # Subtest: Parser
>     ok 1 - Has 13 elements
>     ok 2 - Parameter parsed ok
>     ok 3 - Parameter type ok
>     ok 4 - Flag parsed ok
>     ok 5 - Flag type ok
>     ok 6 - Parameter parsed ok
>     ok 7 - Flag parsed ok
>     ok 8 - Flag parsed ok
>     ok 9 - Flag parsed ok
>     ok 10 - Flag parsed ok
>     ok 11 - Option parsed ok
>     ok 12 - Option value ok
>     ok 13 - Parameter parsed ok
>     ok 14 - Parameter parsed ok
>     ok 15 - Option value ok
>     ok 16 - Option parsed ok
>     ok 17 - Extra parsed ok
>     ok 18 - Option value ok
>     ok 19 - Extra parsed ok
>     ok 20 - Extra parsed ok
>     1..20
> ok 4 - Parser
> ok 5 - no warnings
> ok
> t/04_plugin_config.t ...... 
> 1..5
> # Subtest: Command with config
>     ok 1 - An object of class 'Test01::CommandA' isa 'Test01::CommandA'
>     ok 2 - Arg from command config
>     ok 3 - Arg from command config
>     ok 4 - Config file is set
>     ok 5 - Config loaded
>     1..5
> ok 1 - Command with config
> # Subtest: Another command with config
>     ok 1 - An object of class 'Test01::CommandB' isa 'Test01::CommandB'
>     ok 2 - Arg from command config
>     1..2
> ok 2 - Another command with config
> # Subtest: Command with config and argv
>     ok 1 - An object of class 'Test01::CommandA' isa 'Test01::CommandA'
>     ok 2 - Arg from command config
>     ok 3 - Arg from command config
>     1..3
> ok 3 - Command with config and argv
> # Subtest: Missing config
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Error message set
>     1..2
> ok 4 - Missing config
> ok 5 - no warnings
> ok
> 
>     #   Failed test 'Check enum error message'
>     #   at t/05_extended.t line 244.
>     #          got: 'Validation failed for '__ANON__' with value ggg. Value must be equal to "aaa", "bbb", "ccc", "ddd", "eee", or "fff".'
>     #     expected: 'Value must be one of these values: aaa, bbb, ccc, ddd, eee, fff (not 'ggg')'
>     # Looks like you failed 1 test of 2.
> 
> #   Failed test 'Test enum error message'
> #   at t/05_extended.t line 245.
> # Looks like you failed 1 test of 30.
> t/05_extended.t ........... 
> 1..30
> # Subtest: Non-Fuzzy command matching
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     1..2
> ok 1 - Non-Fuzzy command matching
> # Subtest: Non-Fuzzy attribute matching
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     1..2
> ok 2 - Non-Fuzzy attribute matching
> # Subtest: Private option is not exposed
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     ok 3 - Message is of type error
>     1..3
> ok 3 - Private option is not exposed
> # Subtest: Options from role
>     ok 1 - An object of class 'Test03::SomeCommand' isa 'Test03::SomeCommand'
>     ok 2 - Param is set
>     ok 3 - Role param is set
>     1..3
> ok 4 - Options from role
> # Subtest: Missing attribute value
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     ok 3 - Message is of type error
>     1..3
> ok 5 - Missing attribute value
> # Subtest: All options available & no description
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - No description
>     ok 3 - Message ok
>     1..3
> ok 6 - All options available & no description
> # Subtest: Test type constraints integer
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     1..2
> ok 7 - Test type constraints integer
> # Subtest: Test type constraints hash
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     1..2
> ok 8 - Test type constraints hash
> # Subtest: Test type constraints number
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     1..2
> ok 9 - Test type constraints number
> # Subtest: Test type constraints custom1
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     1..2
> ok 10 - Test type constraints custom1
> # Subtest: Test pass type constraints
>     ok 1 - An object of class 'Test03::AnotherCommand' isa 'Test03::AnotherCommand'
>     ok 2 - Hash ok
>     ok 3 - Hash ok
>     ok 4 - Integer ok
>     ok 5 - Custom type 1 ok
>     ok 6 - Custom type 2 ok
>     ok 7 - Custom type 2 ok
>     ok 8 - Attr set ok
>     ok 9 - Count set ok
>     ok 10 - Split ok
>     1..10
> ok 11 - Test pass type constraints
> # Subtest: Test ambiguous options
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     ok 3 - Message ok
>     1..3
> ok 12 - Test ambiguous options
> # Subtest: Test flags & defaults
>     ok 1 - An object of class 'Test03::YetAnotherCommand' isa 'Test03::YetAnotherCommand'
>     ok 2 - Bool1 flag is undef
>     ok 3 - Bool2 flag is set
>     ok 4 - Bool3 flag is set
>     ok 5 - Value is default
>     1..5
> ok 13 - Test flags & defaults
> # Subtest: Test more flags & defaults
>     ok 1 - An object of class 'Test03::YetAnotherCommand' isa 'Test03::YetAnotherCommand'
>     ok 2 - Bool1 flag is undef
>     ok 3 - Bool2 flag is unset
>     ok 4 - Bool3 flag is set
>     ok 5 - Value is set
>     1..5
> ok 14 - Test more flags & defaults
> # Subtest: Test Negate boolean options
>     ok 1 - An object of class 'Test03::YetAnotherCommand' isa 'Test03::YetAnotherCommand'
>     ok 2 - Bool3 flag is negated
>     1..2
> ok 15 - Test Negate boolean options
> # Subtest: Test positional params
>     ok 1 - An object of class 'Test03::ExtraCommand' isa 'Test03::ExtraCommand'
>     ok 2 - Extra1 value is "hui"
>     ok 3 - Extra2 value is undef
>     ok 4 - alpha value is undef
>     ok 5 - Value is set
>     1..5
> ok 16 - Test positional params
> # Subtest: Test positional params
>     ok 1 - An object of class 'Test03::ExtraCommand' isa 'Test03::ExtraCommand'
>     ok 2 - Extra1 value is "hui"
>     ok 3 - Extra2 value is undef
>     ok 4 - alpha value is undef
>     ok 5 - Value is set
>     1..5
> ok 17 - Test positional params
> # Subtest: Test optional positional params
>     ok 1 - An object of class 'Test03::ExtraCommand' isa 'Test03::ExtraCommand'
>     ok 2 - Extra1 value is "hui"
>     ok 3 - Extra2 value is "11"
>     ok 4 - alpha value is undef
>     ok 5 - Value is set
>     1..5
> ok 18 - Test optional positional params
> # Subtest: Test wrong positional params
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Error message ok
>     ok 3 - Usage header ok
>     ok 4 - Usage body ok
>     1..4
> ok 19 - Test wrong positional params
> # Subtest: Test missing positional params
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     1..2
> ok 20 - Test missing positional params
> # Subtest: Test extra positional params
>     ok 1 - An object of class 'Test03::ExtraCommand' isa 'Test03::ExtraCommand'
>     ok 2 - Param 1 ok
>     ok 3 - Param 2 ok
>     ok 4 - Param 3 ok
>     ok 5 - Uncomsumed option ok
>     1..5
> ok 21 - Test extra positional params
> # Subtest: Test parameter preference
>     ok 1 - An object of class 'Test03::ExtraCommand' isa 'Test03::ExtraCommand'
>     ok 2 - Extra param from new_with_command ok
>     ok 3 - Extra param from argv ok
>     ok 4 - value option from argv ok
>     ok 5 - Flag from new_with_command ok
>     ok 6 - Flago from new_with_command ok
>     1..6
> ok 22 - Test parameter preference
> # Subtest: Test parameter preference reverse
>     ok 1 - An object of class 'Test03::ExtraCommand' isa 'Test03::ExtraCommand'
>     ok 2 - Extra param from new_with_command ok
>     ok 3 - Extra param from argv ok
>     ok 4 - value option from argv ok
>     ok 5 - Flag from new_with_command ok
>     ok 6 - Flago from new_with_command ok
>     1..6
> ok 23 - Test parameter preference reverse
> # Subtest: Test enum error message
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     not ok 2 - Check enum error message
>     1..2
> not ok 24 - Test enum error message
> # Subtest: Test empty multi
>     ok 1 - An object of class 'Test03::SomeCommand' isa 'Test03::SomeCommand'
>     ok 2 - Has three list items
>     ok 3 - First value ok
>     ok 4 - Second value ok
>     ok 5 - First value empty
>     1..5
> ok 25 - Test empty multi
> # Subtest: Test permute
>     ok 1 - Permute array ok
>     ok 2 - Permute hash ok
>     1..2
> ok 26 - Test permute
> # Subtest: Test permute off
>     ok 1 - No permute array ok
>     ok 2 - No permute hash ok
>     1..2
> ok 27 - Test permute off
> # Subtest: Test parameter order
>     ok 1 - Param a ok
>     ok 2 - Param b ok
>     ok 3 - Param c ok
>     1..3
> ok 28 - Test parameter order
> # Subtest: Test mixed multi
>     ok 1 - An object of class 'Test03::SomeCommand' isa 'Test03::SomeCommand'
>     ok 2 - List ok
>     1..2
> ok 29 - Test mixed multi
> ok 30 - no warnings
> Dubious, test returned 1 (wstat 256, 0x100)
> Failed 1/30 subtests 
> t/06_env.t ................ 
> 1..6
> # Subtest: Command with argv
>     ok 1 - An object of class 'Test01::CommandA' isa 'Test01::CommandA'
>     ok 2 - Arg from command config
>     1..2
> ok 1 - Command with argv
> # Subtest: Command only with env
>     ok 1 - An object of class 'Test01::CommandA' isa 'Test01::CommandA'
>     ok 2 - Arg from command env
>     1..2
> ok 2 - Command only with env
> # Subtest: Command with env and argv
>     ok 1 - An object of class 'Test01::CommandA' isa 'Test01::CommandA'
>     ok 2 - Arg from command argv
>     1..2
> ok 3 - Command with env and argv
> # Subtest: Env not passing type constraint
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Message ok
>     1..2
> ok 4 - Env not passing type constraint
> # Subtest: Coerce env value
>     ok 1 - An object of class 'Test01::CommandD' isa 'Test01::CommandD'
>     ok 2 - Arg coerced from command env
>     1..2
> ok 5 - Coerce env value
> ok 6 - no warnings
> ok
> t/07_single.t ............. 
> 1..4
> # Subtest: Single command
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Check for error message
>     1..2
> ok 1 - Single command
> # Subtest: Single command
>     ok 1 - An object of class 'Test05' isa 'Test05'
>     ok 2 - Arg from command ARGV
>     ok 3 - Arg from new_with_options
>     1..3
> ok 2 - Single command
> # Subtest: Single command help
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Usage header is first
>     1..2
> ok 3 - Single command help
> ok 4 - no warnings
> ok
> t/08_plugin_various.t ..... 
> 1..3
> # Subtest: Bash completion
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - some_command present
>     ok 3 - global_option present
>     ok 4 - roleattr present
>     ok 5 - bash_completion is not included
>     1..5
> ok 1 - Bash completion
> # Subtest: Version
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Check for app version
>     ok 3 - Check for MooseX::App version
>     ok 4 - License included
>     1..4
> ok 2 - Version
> ok 3 - no warnings
> ok
> t/09_classes.t ............ 
> 1..7
> # Subtest: Extend base class
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - --test1 included
>     ok 3 - --test2 included
>     ok 4 - --test3 not included
>     1..4
> ok 1 - Extend base class
> # Subtest: Wrong usage
>     ok 1 - Only callable as class method
>     ok 2 - new_with_command may only be called from the application base package
>     ok 3 - Wrong default args
>     1..3
> ok 2 - Wrong usage
> # Subtest: Conflicts
>     ok 1 - Conflict detected
>     1..1
> ok 3 - Conflicts
> # Subtest: Default args available with extra inheritance
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Help ok
>     ok 3 - Help ok
>     ok 4 - An object of class 'Test03::YetAnotherCommand' isa 'Test03::YetAnotherCommand'
>     ok 5 - Option has been passed on
>     1..5
> ok 4 - Default args available with extra inheritance
> # Subtest: Attributes from role
>     ok 1 - An object of class 'Test03::SomeCommand' isa 'Test03::SomeCommand'
>     ok 2 - Attribute from role ok
>     1..2
> ok 5 - Attributes from role
> # Subtest: Correct order from role 
>     ok 1 - An object of class 'Test03::SomeCommand' isa 'Test03::SomeCommand'
>     ok 2 - First from role
>     ok 3 - Second from role
>     ok 4 - Third from role
>     1..4
> ok 6 - Correct order from role 
> ok 7 - no warnings
> ok
> t/10_plugin_mutexgroup.t .. 
> 1..2
> # Subtest: MutexGroup
>     1..7
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - only returned a single error
>     ok 3 - generated an error when more than one option in the same mutexgroup is initialized
>     ok 4 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 5 - only returned a single error
>     ok 6 - generated an error when no options in the same mutexgroup are initialized
>     ok 7 - generated no errors when only a single option from the same mutexgroup is initialized
> ok 1 - MutexGroup
> ok 2 - no warnings
> ok
> t/11_process.t ............ 
> 1..2
> # Subtest: Test basic exit codes
>     ok 1 - Exitcode test02.pl ok
>     ok 2 - Output test02.pl ok
>     ok 3 - Error test02.pl ok
>     ok 4 - Exitcode test02.pl error ok
>     ok 5 - Error test02.pl error ok
>     ok 6 - Exitcode test02.pl version ok
>     ok 7 - Output test02.pl version ok
>     ok 8 - Error test02.pl version ok
>     ok 9 - Exitcode test02.pl version ok
>     ok 10 - Output test02.pl version ok
>     ok 11 - Error test02.pl version ok
>     ok 12 - Exitcode test02.pl record --help ok
>     ok 13 - Output test02.pl record --help ok
>     ok 14 - Error test02.pl record --help ok
>     ok 15 - Exitcode test02.pl record ok
>     ok 16 - Output test02.pl record ok
>     ok 17 - Error test02.pl record ok
>     ok 18 - Exitcode test02.pl record --notthere ok
>     ok 19 - Output test02.pl record --notthere ok
>     ok 20 - Error test02.pl record --notthere ok
>     1..20
> ok 1 - Test basic exit codes
> ok 2 - no warnings
> ok
> t/12_plugin_depends.t ..... 
> 1..2
> # Subtest: Depends
>     1..8
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - only returned a single error
>     ok 3 - generated an error when an option dependency was not present
>     ok 4 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 5 - only returned a single error
>     ok 6 - generated an error when an option dependency was not present
>     ok 7 - generated no errors when both an option and its dependencies are defined
>     ok 8 - generated no errors when both an option and its dependencies are defined
> ok 1 - Depends
> ok 2 - no warnings
> ok
> t/13_rt_112156.t .......... 
> 1..3
> # Subtest: no inheritance
>     1..8
>     ok 1 - An object of class 'Test13::SomeCommand' isa 'Test13::SomeCommand'
>     ok 2 - Option ok
>     ok 3 - Option ok
>     ok 4 - No option
>     ok 5 - An object of class 'Test13::AnotherCommand' isa 'Test13::AnotherCommand'
>     ok 6 - Option ok
>     ok 7 - Option ok
>     ok 8 - Option ok
> ok 1 - no inheritance
> # Subtest: check plugin functionality
>     1..2
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
> ok 2 - check plugin functionality
> ok 3 - no warnings
> ok
> t/14_gh_45.t .............. 
> 1..4
> # Subtest: boolean negation
>     1..4
>     ok 1 - An object of class 'Test14' isa 'Test14'
>     ok 2 - Did not set b1
>     ok 3 - Did set not_b1
>     ok 4 - Did set b2
> ok 1 - boolean negation
> # Subtest: boolean fuzzy negation
>     1..4
>     ok 1 - An object of class 'Test14' isa 'Test14'
>     ok 2 - Did not set b1
>     ok 3 - Did set not_b1
>     ok 4 - Did set b2
> ok 2 - boolean fuzzy negation
> # Subtest: ambiguous negation
>     1..3
>     ok 1 - An object of class 'Test14' isa 'Test14'
>     ok 2 - Did  set b1
>     ok 3 - Did not set b2
> ok 3 - ambiguous negation
> ok 4 - no warnings
> ok
> t/15_subcommands.t ........ 
> 1..4
> # Subtest: Basic Subcommands
>     ok 1 - An object of class 'Test15::Foo' isa 'Test15::Foo'
>     ok 2 - An object of class 'Test15::Foo::Bar' isa 'Test15::Foo::Bar'
>     ok 3 - An object of class 'Test15::Foo::Baz' isa 'Test15::Foo::Baz'
>     ok 4 - An object of class 'Test15::Foo' isa 'Test15::Foo'
>     1..4
> ok 1 - Basic Subcommands
> # Subtest: Help Subcommand
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Command headline set
>     ok 3 - Command body set
>     1..3
> ok 2 - Help Subcommand
> # Subtest: Help Parent
>     ok 1 - An object of class 'MooseX::App::Message::Envelope' isa 'MooseX::App::Message::Envelope'
>     ok 2 - Command headline set
>     ok 3 - Command body set
>     1..3
> ok 3 - Help Parent
> ok 4 - no warnings
> ok
> t/16_rt122946.t ........... 
> 1..2
> # Subtest: Option flags
>     ok 1 - threw Regexp ((?^:Option param[ab] has a single letter flag but no Bool))
>     1..1
> ok 1 - Option flags
> ok 2 - no warnings
> ok
> 
> Test Summary Report
> -------------------
> t/05_extended.t         (Wstat: 256 Tests: 30 Failed: 1)
>   Failed test:  24
>   Non-zero exit status: 1
> Files=17, Tests=164, 11 wallclock secs ( 0.06 usr  0.03 sys + 10.40 cusr  0.71 csys = 11.20 CPU)
> Result: FAIL
> Failed 1/17 test programs. 1/164 subtests failed.
> make[1]: *** [Makefile:973: test_dynamic] Error 255
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> dh_auto_test: error: make -j4 test TEST_VERBOSE=1 returned exit code 2

The full build log is available from:
   http://qa-logs.debian.net/2020/12/26/libmoosex-app-perl_1.41-1_unstable.log

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please marking it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with me
so that we can identify if something relevant changed in the meantime.

About the archive rebuild: The rebuild was done on EC2 VM instances from
Amazon Web Services, using a clean, minimal and up-to-date chroot. Every
failed build was retried once to eliminate random failures.


------8<-----------8<-----------8<-----------8<-----------8<-----

Thanks for considering,
gregor herrmann,
Debian Perl Group

How to specify ~/.myapprc as default config file with MooseX::App::Plugin::Config?

It is a common idiom for myapp to have a default config file in ~/.myapprc without requiring the user to specify --config ~/.myapprc for every invocation.

I've been trying this for hours and can't get it to work with MooseX::App::Plugin::Config. I don't think it is possible, but would love to be proven wrong.

The only thing I've found to work is in my tiny launcher script to do:

my $config = "$ENV{HOME}/.myapprc";
if (-r $config && ! grep /^--config$/, @ARGV) {
    push @ARGV, '--config', $config;
}

But that has a very nasty smell.

I've tried a standard way to override defaults set in Moose roles:

has '+config' => (
    default => File::Spec->catfile($ENV{HOME}, '.myapprc')
);

When I do that, I can get $app->config to have the right value, but $app->_config_data is still empty.

Then I tried to give config and _config_data as parameters to new as in:

my $app = MyApp ->new_with_command(
    config => $config_file,
    _config_data => $config_data
);

And that resulted in both options set, but _config_data doesn't serve as default values to the other options, and then it doesn't really matter.

The reason seems to be that MooseX::App::Meta::Role::Class::Base's sub command_parse_options iterates over $parsed_argv->available('option') and only then sets up default values for the other options. So if there is no --config option in @ARGV itself then the config attribute is ignored you can't set up a default config file. :-( I must admit I didn't understand it fully but my Moose meta-foo is seriously lacking, and Data::Dumper is useless with all the noise from Moose.

Any idea how one could make it possible without having to modify @ARGV before calling MooseX::App?

pod2man error

Hi, packaging for Debian we found this pod2man error:

@@ -463,7 +463,7 @@

Returns a list of all possible option names.

-=head cmd_name_list
+=head2 cmd_name_list

my @NAMEs = $attribute->cmd_name_list();

Cheers,

Makefile.PL fails with no '.' in @INC

A recent security patch to Perl itself removed '.', the current working
directory, from @inc, the default search path for 'use', 'do', and
'require'. This fix for CVE-2016-1238 will be part of Perl 5.26.0, due
to be released this April, 2017. CPAN clients will temporarily
provide backwards compatibility during the module build/test process
by setting the environment variable PERL_USE_UNSAFE_INC=1 during build,
test, and install. HOWEVER:

  1. This environment variable is a temporary fix only for compatibility,
    due to be removed for Perl 5.30.0.
  2. This may mask errors in your module itself, by testing your module
    under different conditions than those that it will actually be run
    under.

To read more about this, you may find the following links helpful:

During a smoke-test of all of cpan, your distribution was found to be unable
to configure, build, test, or install without adding '.' to @inc. This means
that your distribution will stop building properly for all users when the
CPAN clients remove this temporary compatibility fix, and that it may
already have problems when used, problems which are being masked by this
temporary compatibility fix.

A full error log follows:


Output from '/home/cpan4/install/bin/perl Makefile.PL':

Can't locate inc/Module/Install.pm in @INC (you may need to install the inc::Module::Install module) (@INC contains: /tmp/CPAN-Reporter-lib-UyVA /home/cpan4/install/lib/perl5/site_perl/5.26.0/x86_64-linux-thread-multi /home/cpan4/install/lib/perl5/site_perl/5.26.0 /home/cpan4/install/lib/perl5/5.26.0/x86_64-linux-thread-multi /home/cpan4/install/lib/perl5/5.26.0) at Makefile.PL line 3.
BEGIN failed--compilation aborted at Makefile.PL line 3.

------------------------------
PREREQUISITES
------------------------------

Prerequisite modules loaded:

configure_requires:

    Module              Need Have
    ------------------- ---- ----
    ExtUtils::MakeMaker 6.59 7.24


------------------------------
ENVIRONMENT AND OTHER CONTEXT
------------------------------

Environment variables:

    AUTOMATED_TESTING = 1
    HARNESS_OPTIONS = j3
    LANG = en_US.UTF-8
    PATH = /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    PERL = /home/cpan4/install/bin/perl
    PERL5LIB = 
    PERL5OPT = -I/tmp/CPAN-Reporter-lib-UyVA -MDevel::Autoflush
    PERL5_CPANPLUS_IS_RUNNING = 15578
    PERL5_CPAN_IS_EXECUTING = /home/cpan4/.cpan/build/MooseX-App-1.3701-0/Makefile.PL
    PERL5_CPAN_IS_RUNNING = 15578
    PERL5_CPAN_IS_RUNNING_IN_RECURSION = 13578,15578
    PERL_AUTOINSTALL = --defaultdeps
    PERL_CR_SMOKER_CURRENT = MooseX-App-1.3701
    PERL_CR_SMOKER_RUNONCE = 1
    PERL_EXTUTILS_AUTOINSTALL = --defaultdeps
    PERL_MM_USE_DEFAULT = 1
    PERL_USE_UNSAFE_INC = 0
    SHELL = /bin/bash
    TERM = putty-256color

Perl special variables (and OS-specific diagnostics, for MSWin32):

    $^X = /home/cpan4/install/bin/perl
    $UID/$EUID = 1005 / 1005
    $GID = 1005 1005
    $EGID = 1005 1005

Perl module toolchain versions installed:

    Module              Have      
    ------------------- ----------
    CPAN                2.18      
    CPAN::Meta          2.150010  
    Cwd                 3.67      
    ExtUtils::CBuilder  0.280225  
    ExtUtils::Command   7.24      
    ExtUtils::Install   2.04      
    ExtUtils::MakeMaker 7.24      
    ExtUtils::Manifest  1.70      
    ExtUtils::ParseXS   3.34      
    File::Spec          3.67      
    JSON                2.90      
    JSON::PP            2.27400_02
    Module::Build       0.4222    
    Module::Signature   n/a       
    Parse::CPAN::Meta   2.150010  
    Test::Harness       3.38      
    Test::More          1.302079  
    YAML                1.23      
    YAML::Syck          1.29      
    version             0.9917    


--

Summary of my perl5 (revision 5 version 26 subversion 0) configuration:
  Commit id: 5fc389563644287b3e5f448616ce62dd0ce4e7a6
  Platform:
    osname=linux
    osvers=3.16.0-4-amd64
    archname=x86_64-linux-thread-multi
    uname='linux digitalis 3.16.0-4-amd64 #1 smp debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 gnulinux '
    config_args='-Dusedevel -DDEBUGGING -Dusethreads -Dprefix=/home/cpan4/install -Uversiononly -des'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2 -g'
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='4.9.2'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /lib64 /usr/lib64
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.19.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.19'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector-strong'


Characteristics of this binary (from libperl): 
  Compile-time options:
    DEBUGGING
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_IMPLICIT_CONTEXT
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_TRACK_MEMPOOL
    PERL_USE_DEVEL
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
  Built under linux
  Compiled at Apr  4 2017 17:17:49
  %ENV:
    PERL="/home/cpan4/install/bin/perl"
    PERL5LIB=""
    PERL5OPT=""
    PERL5_CPANPLUS_IS_RUNNING="15578"
    PERL5_CPAN_IS_EXECUTING="/home/cpan4/.cpan/build/MooseX-App-1.3701-0/Makefile.PL"
    PERL5_CPAN_IS_RUNNING="15578"
    PERL5_CPAN_IS_RUNNING_IN_RECURSION="13578,15578"
    PERL_AUTOINSTALL="--defaultdeps"
    PERL_CR_SMOKER_CURRENT="MooseX-App-1.3701"
    PERL_CR_SMOKER_RUNONCE="1"
    PERL_EXTUTILS_AUTOINSTALL="--defaultdeps"
    PERL_MM_USE_DEFAULT="1"
    PERL_USE_UNSAFE_INC="0"
  @INC:
    /home/cpan4/install/lib/perl5/site_perl/5.26.0/x86_64-linux-thread-multi
    /home/cpan4/install/lib/perl5/site_perl/5.26.0
    /home/cpan4/install/lib/perl5/5.26.0/x86_64-linux-thread-multi
    /home/cpan4/install/lib/perl5/5.26.0

Tests Fail w/o IO::Interactive

a0bfeba made IO::Interactive recommends instead of required. Without it t/00_load.t line 43 fails. You seem to account for it in the code though but it's absence is definitely the reason for test failures on my system (Perl 5.18.2). I will take a look at fixing this myself once sufficient tuits are available for now just installed it.

#   Failed test 'use MooseX::App::Message::BlockColor;'
#   at t/00_load.t line 42.
#     Tried to use 'MooseX::App::Message::BlockColor'.
#     Error:  Can't locate IO/Interactive.pm in @INC (you may need to install the IO::Interactive module) (@INC contains: /home/mikegrb/.cpanm/work/1395705984.22886/MooseX-App-1.27/inc /home/mikegrb/.cpanm/work/1395705984.22886/MooseX-App-1.27/blib/lib /home/mikegrb/.cpanm/work/1395705984.22886/MooseX-App-1.27/blib/arch /home/mikegrb/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux /home/mikegrb/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2 /home/mikegrb/perl5/perlbrew/perls/perl-5.18.2/lib/5.18.2/x86_64-linux /home/mikegrb/perl5/perlbrew/perls/perl-5.18.2/lib/5.18.2 .) at /home/mikegrb/.cpanm/work/1395705984.22886/MooseX-App-1.27/blib/lib/MooseX/App/Message/BlockColor.pm line 14.
# BEGIN failed--compilation aborted at /home/mikegrb/.cpanm/work/1395705984.22886/MooseX-App-1.27/blib/lib/MooseX/App/Message/BlockColor.pm line 14.
# Compilation failed in require at t/00_load.t line 42.
# BEGIN failed--compilation aborted at t/00_load.t line 42.

Task: I18N

  • Based on current user locale
  • Register languages
  • Register strings (ie by plugins)
  • How to handle PODs?
  • Language fallbacks
  • Allow to specify command documentation in multiple languages

Coercing values from environment (cmd_env).

Would it be possible to coerce values from the environment, when set via cmd_env?
A use case for example is, that my moose type is set to AbsPath (via Types::Path::Tiny), but when I try that with cmd_end, I get the error: "Invalid environment value for ...".

Thanks!

Task: Nested subcommands

  • ie. "mycommand.pl some command" would translate to "MyCommand::Some::Command"
  • How to distinguish between subcommands and positional params?
  • Make sure that help handles subcomands (ie. "mycommand.pl some help" returns a list of available subcommands for "some")
  • Make sure that tall plugins handle subcommands (typo, bashcomplete, man, ...)

App in a Term::ReadLine loop

Hi, I have my first app with a first command and it runs from script myapp via MyApp->new_with_command->run(); fine.

I would write a second myapp-cli like:

    while ( defined ( Term::ReadLine::Event->with_AnyEvent()->readline($prompt) ) ) {
        say $OUT $_; # DEBUG

        # here should MyApp->new_with_command()->run with subcommands and options in $_
        # but a simple
        MyApp->new_with_command->run($_);
        # is not well
        # and last the while loop ist not what I want...
    }

Thank you for a tipp!

Task: Virtual attributes

  • Handled via callbacks
  • Positional and attributes
  • Not sure if really needed - find workaround and add howto pod

Test failures due to changes in ARGV handling in MooseX::App

We had been using an older verison of MooseX::App, and upgraded today to discover that due to changes in ARGV handling, our test cases were now failing. Our tests were written as Test::More subtess, using local() ARGV. e.g.:

subtest 'foo' => sub {
local @argv = (foo => 'blah');
...
};

subtest 'bar' => sub {
local @argv = (bar => 'meh');
....
};

Due to the fact that new_with_command now calls MooseX::App::ParsedArgv->instance(), only the first subtest passes. We are working around this by splitting up our tests into different files, but it would be nice if this was not necessary. Not sure how to fix this as I am unclear as to what the reasoning was for switching to a ARGV singleton.

Thanks!

Support hidden options

Please add support for hidden (undocumented) options, maybe along the lines of

option foo => ( cmd_hidden => 1, ...)

which would cause the foo option not to appear in the generated help/etc. outputs.

MooseX::App::ParsedArgv double encoding

Hello, I found a strange behavior of MooseX::App::ParsedArgv
I suggest not to place global binmode :encoding('UTF-8')
It's broke other scripts and it's not simple to find where problem starts
For example

#!/usr/bin/env perl

# use utf8; 
# there is a bytes not chars
# and it's completely broken after
# MooseX::App::ParsedArgv->instance call
use MooseX::App::ParsedArgv;

print "Строка в кодировке юникод на русском языке (String in unicode encoding in Russian)\n";
my $argv = MooseX::App::ParsedArgv->instance; 
print "Строка в кодировке юникод на русском языке (String in unicode encoding in Russian)\n";

and output different according to locale

$ LC_ALL=ru_RU.UTF-8 perl bug_appparsed.pl
Строка в кодировке юникод на русском языке (String in unicode encoding in Russian)
СÑ<82>Ñ<80>ока в кодиÑ<80>овке Ñ<8e>никод на Ñ<80>Ñ<83>Ñ<81>Ñ<81>ком Ñ<8f>зÑ<8b>ке (String in unicode encoding in Russian)

$ LC_ALL=C perl bug_appparsed.pl
Строка в кодировке юникод на русском языке (String in unicode encoding in Russian)
Строка в кодировке юникод на русском языке (String in unicode encoding in Russian)

Parse # ABSTRACT: when =head1 NAME is missing?

I will gladly accept a patch/pull request. The best place to add this functionality would be in lib/MooseX/App/Meta/Role/Class/Command.pm . The _build_command_pod method has a loop where you can parse all 'Pod::Elemental::Element::Pod5::Nonpod' elements.

Cheers
Maroš

MooseX-App has both a LICENSE and a LICENCE file

MooseX-App-1.41 has both a LICENSE and a LICENCE file in its tarball.

This is somewhat confusing, especially when you consider each file gives a different postal address (the one in the LICENSE file is the correct address).

[PATCH] fix some spelling mistakes in the POD

In Debian we are currently applying the following patch to
MooseX-App.
We thought you might be interested in it too.

Description: fix some spelling mistakes in the POD
Origin: vendor
Author: gregor herrmann <[email protected]>
Last-Update: 2016-04-03

The patch is tracked in our Git repository at
https://anonscm.debian.org/cgit/pkg-perl/packages/libmoosex-app-perl.git/plain/debian/patches/spelling.patch

Thanks for considering,
gregor herrmann,
Debian Perl Group

Feature Request - Reformat --help docs

Hello,

Thanks for the great library! I don't think there's anything better out there for writing command line apps. ;-)

When using MooseX::Getopt::Long::Usage I get help docs that look like this:

`
➜ ~ mcerunner.pl
Required option missing: infile
Usage:
mcerunner.pl [OPTIONS]

Options:
Required:
--infile - Str. File of commands separated by newline. The command 'wait' indicates all previous commands should finish before starting the next one.
Optional:
--help -? --usage - Bool. Display the usage message and exit
--using_mce - Bool. Default=1.
--outdir - Str. Directory to write out files.
`
I quite like the way they are separated into 'Required' and 'Optional' items, and the formatting of type and defaults.

I've dug around in the code a little, but I don't have a real clear idea of how difficult this would be to implement. I could work on it and generate a PR if that is ok with you.

screenshot from 2016-06-14 13-03-07

MooseX-App-1.41 t/05_extended.t is failing

perl 5.14.2
platform AIX 7.2

t/05_extended.t ........... 1/30
    #   Failed test 'Check enum error message'
    #   at t/05_extended.t line 244.
    #          got: 'Validation failed for '__ANON__' with value ggg. Value must be equal to "aaa", "bbb", "ccc", "ddd" "eee", or "fff".'
    #     expected: 'Value must be one of these values: aaa, bbb, ccc, ddd, eee, fff (not 'ggg')'
    # Looks like you failed 1 test of 2.

#   Failed test 'Test enum error message'
#   at t/05_extended.t line 245.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.