The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Stow::Check - Base class for stow-check script.

SYNOPSIS

 use App::Stow::Check;

 my $app = App::Stow::Check->new;
 my $exit_code = $app->run;

METHODS

new

 my $app = App::Stow::Check->new;

Constructor.

Returns instance of object.

run

 my $exit_code = $app->run;

Run method. Check if command is in stow directory and print error message (STDERR, exit code 1) or dist name (STDOUT, exit code 0).

Returns exit code.

ERRORS

 run():
         Command '%s' doesn't use stow.
         Command '%s' don't use 'bin/sbin' path.
         Command '%s' not found.
         Stow directory '%s' doesn't exist.

EXAMPLE

 use strict;
 use warnings;

 use App::Stow::Check;

 # Arguments.
 @ARGV = (
         '-h',
 );

 # Run.
 exit App::Stow::Check->new->run;

 # Output:
 # Usage: ./ex1.pl [-d stow_dir] [-h] [--version] command
 #         -d stow_dir     Stow directory (default value is '/usr/local/stow').
 #         -h              Print help.
 #         --version       Print version.
 #         command         Command for which is stow dist looking.

DEPENDENCIES

Cwd, File::Spec::Functions, File::Which, Getopt::Std, Readonly.

REPOSITORY

https://github.com/michal-josef-spacek/App-Stow-Check

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2021-2022 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.03