App-SymlinkUtils

 view release on metacpan or  search on metacpan

script/check-symlink  view on Meta::CPAN


use 5.010001;
use strict;
use warnings;
use Log::ger;

use Perinci::CmdLine::Any;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-08-25'; # DATE
our $DIST = 'App-SymlinkUtils'; # DIST
our $VERSION = '0.004'; # VERSION

my $cmdline = Perinci::CmdLine::Any->new(
    url => "/App/SymlinkUtils/check_symlink",
    program_name => "check-symlink",
    log => 1,
    read_config => 0,
    read_env => 0,
);

$cmdline->run;

# ABSTRACT: Perform various checks on a symlink
# PODNAME: check-symlink

__END__

=pod

=encoding UTF-8

=head1 NAME

check-symlink - Perform various checks on a symlink

=head1 VERSION

This document describes version 0.004 of check-symlink (from Perl distribution App-SymlinkUtils), released on 2023-08-25.

=head1 SYNOPSIS

B<check-symlink> B<L<--help|/"--help, -h, -?">> (or B<L<-h|/"--help, -h, -?">>, B<L<-?|/"--help, -h, -?">>)

B<check-symlink> B<L<--version|/"--version, -v">> (or B<L<-v|/"--version, -v">>)

B<check-symlink> [B<L<--content-matches|/"--content-matches">>|B<L<--no-content-matches|/"--content-matches">>|B<L<--nocontent-matches|/"--content-matches">>] [B<L<--debug|/"--debug">>|B<L<--log-level|/"--log-level=s">>=I<level>|B<L<--quiet|/"--quiet...

=head1 OPTIONS

C<*> marks required options.

=head2 Main options

=over

=item B<--content-matches>

Whether content should match extension.

If set to true, will guess media type from content and check that file extension
exists nd matches the media type. Requires L<File::MimeInfo::Magic>, which is
only specified as a "Recommends" dependency by File-Symlink-Util distribution.


=item B<--ext-matches>

Whether extension should match.

If set to true, then if both symlink name and target filename contain filename
extension (e.g. C<jpg>) then they must match. Case variation is allowed (e.g.
C<JPG>) but other variation is not (e.g. C<jpeg>).


=item B<--is-abs>

Whether we should check that symlink target is an absolute path.

If set to true, then symlink target must be an absolute path. If
set to false, then symlink target must be a relative path.


=item B<--is-rel>

Alias for --isnt-abs.

See C<--is-abs>.

=item B<--isnt-rel>

Alias for --is-abs.

See C<--is-abs>.

=item B<--symlink>=I<s>*

Path to the symlink to be checked.

Can also be specified as the 1st command-line argument.

=item B<--target>=I<s>

Expected target path.

If specified, then target of symlink (after normalized to absolute path) will be
checked and must point to this target.


Can also be specified as the 2nd command-line argument.

=back

=head2 Logging options

=over

=item B<--debug>

Shortcut for --log-level=debug.

=item B<--log-level>=I<s>



( run in 2.612 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )