Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MooseX-App CPAN distribution.

Report information
The Basics
Id: 112156
Status: resolved
Priority: 0/
Queue: MooseX-App

People
Owner: Nobody in particular
Requestors: Marc.Logghe [...] ablynx.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: MooseX::App::Plugin::Term issue ?
Date: Fri, 19 Feb 2016 12:46:51 +0000
To: "bug-moosex-app [...] rt.cpan.org" <bug-moosex-app [...] rt.cpan.org>
From: Marc Logghe <Marc.Logghe [...] ablynx.com>
Hi Maroš, I'm currently in the process of creating a custom plugin but ran into an issue. So, I decided to take a few steps back and use the Term plugin as an example and actually ran into the very same issue when trying out the synopsis. The output is shown below. I have the impression I'm overlooking something. Thanks and regards, Marc Found unknown argument 'cmd_term' in the attribute constructor for 'some_option' in class MyApp::SomeCommand at /usr/lib/perl5/Moose/Meta/Attribute.pm line 118. Moose::Meta::Attribute::new('Moose::Meta::Class::__ANON__::SERIAL::13', 'some_option', 'definition_context', 'HASH(0x2defeb8)', 'documentation', 'Something', 'cmd_term', 1, 'is', ...) called at /usr/local/share/perl/5.18.2/MooseX/App/Meta/Role/Attribute/Option.pm line 66 Class::MOP::Class:::around('CODE(0x251ae60)', 'Moose::Meta::Class::__ANON__::SERIAL::13', 'some_option', 'definition_context', 'HASH(0x2defeb8)', 'documentation', 'Something', 'cmd_term', 1, ...) called at /usr/lib/perl5/Class/MOP/Method/Wrapped.pm line 162 Class::MOP::Method::Wrapped::__ANON__('Moose::Meta::Class::__ANON__::SERIAL::13', 'some_option', 'definition_context', 'HASH(0x2defeb8)', 'documentation', 'Something', 'cmd_term', 1, 'is', ...) called at /usr/lib/perl5/Class/MOP/Method/Wrapped.pm line 91 Moose::Meta::Class::__ANON__::SERIAL::13::new('Moose::Meta::Class::__ANON__::SERIAL::13', 'some_option', 'definition_context', 'HASH(0x2defeb8)', 'documentation', 'Something', 'cmd_term', 1, 'is', ...) called at /usr/lib/perl5/Moose/Meta/Attribute.pm line 129 Moose::Meta::Attribute::interpolate_class_and_new('Moose::Meta::Class::__ANON__::SERIAL::13', 'some_option', 'cmd_term', 1, 'definition_context', 'HASH(0x2defeb8)', 'isa', 'Int', 'is', ...) called at /usr/lib/perl5/Moose/Meta/Class.pm line 714 Moose::Meta::Class::_process_new_attribute('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', 'some_option', 'cmd_term', 1, 'definition_context', 'HASH(0x2defeb8)', 'isa', 'Int', 'is', ...) called at /usr/lib/perl5/Moose/Meta/Class.pm line 707 Moose::Meta::Class::_process_attribute('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', 'some_option', 'cmd_term', 1, 'definition_context', 'HASH(0x2defeb8)', 'isa', 'Int', 'is', ...) called at /usr/lib/perl5/Moose/Meta/Class.pm line 576 Moose::Meta::Class::add_attribute('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', 'some_option', 'cmd_term', 1, 'definition_context', 'HASH(0x2defeb8)', 'isa', 'Int', 'is', ...) called at /usr/local/share/perl/5.18.2/MooseX/App/Exporter.pm line 70 MooseX::App::Exporter::_handle_attribute('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', 'some_option', 'option', 'is', 'rw', 'isa', 'Int', 'documentation', 'Something', ...) called at /usr/local/share/perl/5.18.2/MooseX/App/Exporter.pm line 42 MooseX::App::Exporter::option('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', 'some_option', 'is', 'rw', 'isa', 'Int', 'documentation', 'Something', 'cmd_term', ...) called at /usr/lib/perl5/Moose/Exporter.pm line 409 MooseX::App::Command::option('some_option', 'is', 'rw', 'isa', 'Int', 'documentation', 'Something', 'cmd_term', 1, ...) called at lib/MyApp/SomeCommand.pm line 4 require MyApp/SomeCommand.pm called at /usr/local/share/perl/5.18.2/Module/Runtime.pm line 317 Module::Runtime::require_module('MyApp::SomeCommand') called at /usr/share/perl5/Class/Load.pm line 177 Class::Load::try {...} () called at /usr/local/share/perl/5.18.2/Try/Tiny.pm line 76 eval {...} called at /usr/local/share/perl/5.18.2/Try/Tiny.pm line 72 Try::Tiny::try('CODE(0x391d2b0)', 'Try::Tiny::Catch=REF(0x391d730)') called at /usr/share/perl5/Class/Load.pm line 183 Class::Load::try_load_class('MyApp::SomeCommand') called at /usr/local/share/perl/5.18.2/MooseX/App/Role/Base.pm line 19 MooseX::App::Role::Base::initialize_command_class('MyApp', 'MyApp::SomeCommand') called at /usr/local/share/perl/5.18.2/MooseX/App.pm line 134 MooseX::App::new_with_command('MyApp') called at ./myapp line 3 usage: myapp some_command [long options...] myapp help myapp some_command --help options: --help -h --usage -? Prints this usage information. [Flag] --some_option Something [Integer] Show quoted text
________________________________________ THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. If the reader of this E-mail message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately at ablynx@ablynx.com. Thank you for your co-operation. "NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V.
________________________________________
Hi Marc, yes indeed this is a bug. Option attributes don't seem to be propagated into command classes unless your command classes inherit from your base class. As an immediate workaround I suggest to add 'extend qw(MyApp);' into you command class using cmd_term. I'll have a look into this issue in the meantime. Cheers Maroš Show quoted text
> I'm currently in the process of creating a custom plugin but ran into > an issue. So, I decided to take a few steps back and use the Term > plugin as an example and actually ran into the very same issue when > trying out the synopsis. > The output is shown below. > I have the impression I'm overlooking something. > > Thanks and regards, > Marc > > > Found unknown argument 'cmd_term' in the attribute constructor for > 'some_option' in class MyApp::SomeCommand at > /usr/lib/perl5/Moose/Meta/Attribute.pm line 118. > Moose::Meta::Attribute::new('Moose::Meta::Class::__ANON__::SERIAL::13', > 'some_option', 'definition_context', 'HASH(0x2defeb8)', > 'documentation', 'Something', 'cmd_term', 1, 'is', ...) called at > /usr/local/share/perl/5.18.2/MooseX/App/Meta/Role/Attribute/Option.pm > line 66 > Class::MOP::Class:::around('CODE(0x251ae60)', > 'Moose::Meta::Class::__ANON__::SERIAL::13', 'some_option', > 'definition_context', 'HASH(0x2defeb8)', 'documentation', 'Something', > 'cmd_term', 1, ...) called at > /usr/lib/perl5/Class/MOP/Method/Wrapped.pm line 162 > Class::MOP::Method::Wrapped::__ANON__('Moose::Meta::Class::__ANON__::SERIAL::13', > 'some_option', 'definition_context', 'HASH(0x2defeb8)', > 'documentation', 'Something', 'cmd_term', 1, 'is', ...) called at > /usr/lib/perl5/Class/MOP/Method/Wrapped.pm line 91 > Moose::Meta::Class::__ANON__::SERIAL::13::new('Moose::Meta::Class::__ANON__::SERIAL::13', > 'some_option', 'definition_context', 'HASH(0x2defeb8)', > 'documentation', 'Something', 'cmd_term', 1, 'is', ...) called at > /usr/lib/perl5/Moose/Meta/Attribute.pm line 129 > Moose::Meta::Attribute::interpolate_class_and_new('Moose::Meta::Class::__ANON__::SERIAL::13', > 'some_option', 'cmd_term', 1, 'definition_context', 'HASH(0x2defeb8)', > 'isa', 'Int', 'is', ...) called at /usr/lib/perl5/Moose/Meta/Class.pm > line 714 > Moose::Meta::Class::_process_new_attribute('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', > 'some_option', 'cmd_term', 1, 'definition_context', 'HASH(0x2defeb8)', > 'isa', 'Int', 'is', ...) called at /usr/lib/perl5/Moose/Meta/Class.pm > line 707 > Moose::Meta::Class::_process_attribute('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', > 'some_option', 'cmd_term', 1, 'definition_context', 'HASH(0x2defeb8)', > 'isa', 'Int', 'is', ...) called at /usr/lib/perl5/Moose/Meta/Class.pm > line 576 > Moose::Meta::Class::add_attribute('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', > 'some_option', 'cmd_term', 1, 'definition_context', 'HASH(0x2defeb8)', > 'isa', 'Int', 'is', ...) called at > /usr/local/share/perl/5.18.2/MooseX/App/Exporter.pm line 70 > MooseX::App::Exporter::_handle_attribute('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', > 'some_option', 'option', 'is', 'rw', 'isa', 'Int', 'documentation', > 'Something', ...) called at > /usr/local/share/perl/5.18.2/MooseX/App/Exporter.pm line 42 > MooseX::App::Exporter::option('Moose::Meta::Class::__ANON__::SERIAL::14=HASH(0x39597b0)', > 'some_option', 'is', 'rw', 'isa', 'Int', 'documentation', 'Something', > 'cmd_term', ...) called at /usr/lib/perl5/Moose/Exporter.pm line 409 > MooseX::App::Command::option('some_option', 'is', 'rw', 'isa', > 'Int', 'documentation', 'Something', 'cmd_term', 1, ...) called at > lib/MyApp/SomeCommand.pm line 4 > require MyApp/SomeCommand.pm called at > /usr/local/share/perl/5.18.2/Module/Runtime.pm line 317 > Module::Runtime::require_module('MyApp::SomeCommand') called > at /usr/share/perl5/Class/Load.pm line 177 > Class::Load::try {...} () called at > /usr/local/share/perl/5.18.2/Try/Tiny.pm line 76 > eval {...} called at /usr/local/share/perl/5.18.2/Try/Tiny.pm > line 72 > Try::Tiny::try('CODE(0x391d2b0)', > 'Try::Tiny::Catch=REF(0x391d730)') called at > /usr/share/perl5/Class/Load.pm line 183 > Class::Load::try_load_class('MyApp::SomeCommand') called at > /usr/local/share/perl/5.18.2/MooseX/App/Role/Base.pm line 19 > MooseX::App::Role::Base::initialize_command_class('MyApp', > 'MyApp::SomeCommand') called at > /usr/local/share/perl/5.18.2/MooseX/App.pm line 134 > MooseX::App::new_with_command('MyApp') called at ./myapp line > 3 > usage: > myapp some_command [long options...] > myapp help > myapp some_command --help > > options: > --help -h --usage -? Prints this usage information. [Flag] > --some_option Something [Integer] > > ________________________________________ > THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR > ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS > PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. > If the reader of this E-mail message is not the intended recipient, > you are hereby notified that any dissemination, distribution or > copying of this communication is strictly prohibited. If you have > received this communication in error, please notify us immediately at > ablynx@ablynx.com. Thank you for your co-operation. > "NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V. > ________________________________________
Subject: RE: [rt.cpan.org #112156] MooseX::App::Plugin::Term issue ?
Date: Fri, 19 Feb 2016 14:53:16 +0000
To: "bug-MooseX-App [...] rt.cpan.org" <bug-MooseX-App [...] rt.cpan.org>
From: Marc Logghe <Marc.Logghe [...] ablynx.com>
Great, thanks for the prompt answer. Looks like an easy workaround but I would not have figured out that by myself. Still struggling to wrap my brain around Moose and MooseX::App and in finding the beauty. Because I am pretty sure it is a beautiful piece of code that you can appreciate the best when you manage to fully understand it :-) Thanks again. Cheers, Marc Show quoted text
-----Original Message----- From: Maroš Kollár via RT [mailto:bug-MooseX-App@rt.cpan.org] Sent: vrijdag 19 februari 2016 15:42 To: Marc Logghe <Marc.Logghe@ablynx.com> Subject: [rt.cpan.org #112156] MooseX::App::Plugin::Term issue ? <URL: https://rt.cpan.org/Ticket/Display.html?id=112156 > Hi Marc, yes indeed this is a bug. Option attributes don't seem to be propagated into command classes unless your command classes inherit from your base class. As an immediate workaround I suggest to add 'extend qw(MyApp);' into you command class using cmd_term. I'll have a look into this issue in the meantime. Cheers Maroš
> I'm currently in the process of creating a custom plugin but ran into > an issue. So, I decided to take a few steps back and use the Term > plugin as an example and actually ran into the very same issue when > trying out the synopsis. > The output is shown below. > I have the impression I'm overlooking something. > > Thanks and regards, > Marc > > > Found unknown argument 'cmd_term' in the attribute constructor for > 'some_option' in class MyApp::SomeCommand at > /usr/lib/perl5/Moose/Meta/Attribute.pm line 118. > > Moose::Meta::Attribute::new('Moose::Meta::Class::__ANON__::SERIAL::13' > , 'some_option', 'definition_context', 'HASH(0x2defeb8)', > 'documentation', 'Something', 'cmd_term', 1, 'is', ...) called at > /usr/local/share/perl/5.18.2/MooseX/App/Meta/Role/Attribute/Option.pm > line 66 > Class::MOP::Class:::around('CODE(0x251ae60)', > 'Moose::Meta::Class::__ANON__::SERIAL::13', 'some_option', > 'definition_context', 'HASH(0x2defeb8)', 'documentation', 'Something', > 'cmd_term', 1, ...) called at > /usr/lib/perl5/Class/MOP/Method/Wrapped.pm line 162 > > Class::MOP::Method::Wrapped::__ANON__('Moose::Meta::Class::__ANON__::S > ERIAL::13', 'some_option', 'definition_context', 'HASH(0x2defeb8)', > 'documentation', 'Something', 'cmd_term', 1, 'is', ...) called at > /usr/lib/perl5/Class/MOP/Method/Wrapped.pm line 91 > > Moose::Meta::Class::__ANON__::SERIAL::13::new('Moose::Meta::Class::__A > NON__::SERIAL::13', 'some_option', 'definition_context', > 'HASH(0x2defeb8)', 'documentation', 'Something', 'cmd_term', 1, 'is', > ...) called at /usr/lib/perl5/Moose/Meta/Attribute.pm line 129 > > Moose::Meta::Attribute::interpolate_class_and_new('Moose::Meta::Class: > :__ANON__::SERIAL::13', 'some_option', 'cmd_term', 1, > 'definition_context', 'HASH(0x2defeb8)', 'isa', 'Int', 'is', ...) > called at /usr/lib/perl5/Moose/Meta/Class.pm > line 714 > > Moose::Meta::Class::_process_new_attribute('Moose::Meta::Class::__ANON > __::SERIAL::14=HASH(0x39597b0)', 'some_option', 'cmd_term', 1, > 'definition_context', 'HASH(0x2defeb8)', 'isa', 'Int', 'is', ...) > called at /usr/lib/perl5/Moose/Meta/Class.pm > line 707 > > Moose::Meta::Class::_process_attribute('Moose::Meta::Class::__ANON__:: > SERIAL::14=HASH(0x39597b0)', 'some_option', 'cmd_term', 1, > 'definition_context', 'HASH(0x2defeb8)', 'isa', 'Int', 'is', ...) > called at /usr/lib/perl5/Moose/Meta/Class.pm > line 576 > > Moose::Meta::Class::add_attribute('Moose::Meta::Class::__ANON__::SERIA > L::14=HASH(0x39597b0)', 'some_option', 'cmd_term', 1, > 'definition_context', 'HASH(0x2defeb8)', 'isa', 'Int', 'is', ...) > called at /usr/local/share/perl/5.18.2/MooseX/App/Exporter.pm line 70 > > MooseX::App::Exporter::_handle_attribute('Moose::Meta::Class::__ANON__ > ::SERIAL::14=HASH(0x39597b0)', 'some_option', 'option', 'is', 'rw', > 'isa', 'Int', 'documentation', 'Something', ...) called at > /usr/local/share/perl/5.18.2/MooseX/App/Exporter.pm line 42 > > MooseX::App::Exporter::option('Moose::Meta::Class::__ANON__::SERIAL::1 > 4=HASH(0x39597b0)', 'some_option', 'is', 'rw', 'isa', 'Int', > 'documentation', 'Something', 'cmd_term', ...) called at > /usr/lib/perl5/Moose/Exporter.pm line 409 > MooseX::App::Command::option('some_option', 'is', 'rw', 'isa', > 'Int', 'documentation', 'Something', 'cmd_term', 1, ...) called at > lib/MyApp/SomeCommand.pm line 4 > require MyApp/SomeCommand.pm called at > /usr/local/share/perl/5.18.2/Module/Runtime.pm line 317 > Module::Runtime::require_module('MyApp::SomeCommand') called > at /usr/share/perl5/Class/Load.pm line 177 > Class::Load::try {...} () called at > /usr/local/share/perl/5.18.2/Try/Tiny.pm line 76 > eval {...} called at /usr/local/share/perl/5.18.2/Try/Tiny.pm > line 72 > Try::Tiny::try('CODE(0x391d2b0)', > 'Try::Tiny::Catch=REF(0x391d730)') called at > /usr/share/perl5/Class/Load.pm line 183 > Class::Load::try_load_class('MyApp::SomeCommand') called at > /usr/local/share/perl/5.18.2/MooseX/App/Role/Base.pm line 19 > MooseX::App::Role::Base::initialize_command_class('MyApp', > 'MyApp::SomeCommand') called at > /usr/local/share/perl/5.18.2/MooseX/App.pm line 134 > MooseX::App::new_with_command('MyApp') called at ./myapp line > 3 > usage: > myapp some_command [long options...] > myapp help > myapp some_command --help > > options: > --help -h --usage -? Prints this usage information. [Flag] > --some_option Something [Integer] > > ________________________________________ > THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR > ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS > PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. > If the reader of this E-mail message is not the intended recipient, > you are hereby notified that any dissemination, distribution or > copying of this communication is strictly prohibited. If you have > received this communication in error, please notify us immediately at > ablynx@ablynx.com. Thank you for your co-operation. > "NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V. > ________________________________________
________________________________________ THIS E-MAIL MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. If the reader of this E-mail message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately at ablynx@ablynx.com. Thank you for your co-operation. "NANOBODY" and "NANOCLONE" are registered trademarks of Ablynx N.V.
________________________________________
Fixed in 1.34