#=============================================================================== # # Module: Term::CLI::Argument::String # # Description: Class for arbitrary string arguments in Term::CLI # # Author: Steven Bakker (SBAKKER), # Created: 22/01/18 # # Copyright (c) 2018 Steven Bakker # # This module is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. See "perldoc perlartistic." # # This software is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # #=============================================================================== use 5.014_001; package Term::CLI::Argument::String 0.03001 { use Modern::Perl; use Moo; use namespace::clean; extends 'Term::CLI::Argument'; sub validate { my ($self, $value) = @_; $self->set_error(''); if (!defined $value) { return $self->set_error("value must be defined"); } return $value; } } 1; __END__ =pod =head1 NAME Term::CLI::Argument::String - class for basic string arguments in Term::CLI =head1 VERSION version 0.03001 =head1 SYNOPSIS use Term::CLI::Argument::String; my $arg = Term::CLI::Argument::String->new(name => 'arg1'); =head1 DESCRIPTION Simple class for string arguments in L(3p). This is basically the L(3p) class, but also allowing empty strings. =head1 CLASS STRUCTURE =head2 Inherits from: L(3p). =head2 Consumes: None. =head1 CONSTRUCTORS See L(3p). =head1 ACCESSORS See L(3p). =head1 METHODS See L(3p). =over =item B ( I ) Overloaded from L to also allow empty strings. =back =head1 SEE ALSO L(3p), L(3p). =head1 AUTHOR Steven Bakker Esbakker@cpan.orgE, 2018. =head1 COPYRIGHT AND LICENSE Copyright (c) 2018 Steven Bakker This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See "perldoc perlartistic." This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =cut