Skip to content

Commit

Permalink
Test synopsis and fix test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Maros Kollar committed Oct 21, 2023
1 parent 30caea0 commit aac44e4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/MooseX/App/Plugin/Term/Meta/Attribute.pm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ sub cmd_term_read_string {
if (! $history_disable
&& defined $entry
&& $entry !~ m/^\s*$/
&& ! first { $entry eq $_ } @history)) {
&& ! first { $entry eq $_ } @history) {
push(@history,$entry);
}
};
Expand Down
23 changes: 23 additions & 0 deletions t/example/test_synopsis.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package MyApp {
use MooseX::App qw(Term);
};

package MyApp::SomeCommand {
use 5.020;
use MooseX::App::Command;
extends qw(MyApp);

option 'some_option' => (
is => 'rw',
isa => 'Int',
documentation => 'Something',
cmd_term => 1,
);

sub run {
my ($self) = @_;
say "Some option is ".$self->some_option;
}
};

MyApp->new_with_command->run;

0 comments on commit aac44e4

Please sign in to comment.