App-DistUtils
view release on metacpan or search on metacpan
lib/App/DistUtils.pm view on Meta::CPAN
our $DATE = '2023-05-20'; # DATE
our $DIST = 'App-DistUtils'; # DIST
our $VERSION = '0.154'; # VERSION
our %dist_arg_single = (
dist => {
summary => 'Distribution name, defaults to "this dist"',
schema => 'perl::distname::default_this_dist*',
description => <<'_',
See the <prog:this-dist> utility for how to guess for "this distribution".
_
pos => 0,
completion => sub {
require Complete::Dist;
my %args = @_;
Complete::Dist::complete_dist(word=>$args{word});
},
},
);
script/dist-dir view on Meta::CPAN
C<*> marks required options.
=head2 Main options
=over
=item B<--dist>=I<s>
Distribution name, defaults to "this dist".
See the L<this-dist> utility for how to guess for "this distribution".
Can also be specified as the 1st command-line argument.
=item B<--tarball>, B<-t>
(No description)
=back
script/list-dist-contents view on Meta::CPAN
C<*> marks required options.
=head2 Main options
=over
=item B<--dist>=I<s>
Distribution name, defaults to "this dist".
See the L<this-dist> utility for how to guess for "this distribution".
Can also be specified as the 1st command-line argument.
=back
=head2 Configuration options
=over
script/list-dist-modules view on Meta::CPAN
C<*> marks required options.
=head2 Main options
=over
=item B<--dist>=I<s>
Distribution name, defaults to "this dist".
See the L<this-dist> utility for how to guess for "this distribution".
Can also be specified as the 1st command-line argument.
=back
=head2 Configuration options
=over
script/pwd2dist view on Meta::CPAN
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-05-20'; # DATE
our $DIST = 'App-DistUtils'; # DIST
our $VERSION = '0.154'; # VERSION
our %SPEC;
$SPEC{pwd2dist} = {
v => 1.1,
summary => 'Try to guess/extract dist name from current directory',
description => <<'_',
Will return `.` if dist name cannot be guessed.
_
args => {
},
result_naked => 1,
};
sub pwd2dist {
my %args = @_;
my $cwd = $ENV{PWD} // do { require Cwd; Cwd::cwd() };
$cwd =~ s!.+[/\\]!!;
$cwd =~ s/^(perl|cpan|p5|pl)-//;
$cwd =~ /\A\w+(-\w+)*\z/ ? $cwd : ".";
}
Perinci::CmdLine::Any->new(
url => "/main/pwd2dist",
)->run;
# ABSTRACT: Try to guess/extract dist name from current directory
# PODNAME: pwd2dist
__END__
=pod
=encoding UTF-8
=head1 NAME
pwd2dist - Try to guess/extract dist name from current directory
=head1 VERSION
This document describes version 0.154 of pwd2dist (from Perl distribution App-DistUtils), released on 2023-05-20.
=head1 SYNOPSIS
% pwd
/home/ujang/proj/perl-Foo-Bar
% pwd2dist
Foo-Bar
=head1 DESCRIPTION
Will return C<.> if dist name cannot be guessed.
=head1 OPTIONS
C<*> marks required options.
=head2 Configuration options
=over
=item B<--config-path>=I<s>, B<-c>
script/pwd2mod view on Meta::CPAN
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-05-20'; # DATE
our $DIST = 'App-DistUtils'; # DIST
our $VERSION = '0.154'; # VERSION
our %SPEC;
$SPEC{pwd2mod} = {
v => 1.1,
summary => 'Try to guess/extract module name from current directory',
description => <<'_',
Will return `.` if module name cannot be guessed.
_
args => {
},
result_naked => 1,
};
sub pwd2mod {
my %args = @_;
my $cwd = $ENV{PWD} // do { require Cwd; Cwd::cwd() };
script/pwd2mod view on Meta::CPAN
$cwd =~ s!.+[/\\]!!;
$cwd =~ s/^(perl5?|cpan|p5?|pl)-//;
$cwd =~ s/-/::/g;
$cwd =~ /\A\w+(::\w+)*\z/ ? $cwd : ".";
}
Perinci::CmdLine::Any->new(
url => "/main/pwd2mod",
)->run;
# ABSTRACT: Try to guess/extract module name from current directory
# PODNAME: pwd2mod
__END__
=pod
=encoding UTF-8
=head1 NAME
pwd2mod - Try to guess/extract module name from current directory
=head1 VERSION
This document describes version 0.154 of pwd2mod (from Perl distribution App-DistUtils), released on 2023-05-20.
=head1 SYNOPSIS
% pwd
/home/ujang/proj/perl-Foo-Bar
% pwd2mod
Foo::Bar
=head1 DESCRIPTION
Will return C<.> if module name cannot be guessed.
=head1 OPTIONS
C<*> marks required options.
=head2 Configuration options
=over
=item B<--config-path>=I<s>, B<-c>
( run in 1.176 second using v1.01-cache-2.11-cpan-702932259ff )