App-FilenameUtils

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
lib/App/FilenameUtils.pm
script/check-archive-filename
script/check-audio-filename
script/check-backup-filename
script/check-compressed-filename
script/check-ebook-filename
script/check-executable-filename
script/check-image-filename
script/check-media-filename
script/check-video-filename
t/00-compile.t
t/author-critic.t
t/author-pod-coverage.t
t/author-pod-syntax.t

META.json  view on Meta::CPAN

            "name" : "GenPericmdScript check-archive-filename",
            "version" : "0.423"
         },
         {
            "class" : "Dist::Zilla::Plugin::GenPericmdScript",
            "name" : "GenPericmdScript check-audio-filename",
            "version" : "0.423"
         },
         {
            "class" : "Dist::Zilla::Plugin::GenPericmdScript",
            "name" : "GenPericmdScript check-backup-filename",
            "version" : "0.423"
         },
         {
            "class" : "Dist::Zilla::Plugin::GenPericmdScript",
            "name" : "GenPericmdScript check-compressed-filename",
            "version" : "0.423"
         },
         {
            "class" : "Dist::Zilla::Plugin::GenPericmdScript",
            "name" : "GenPericmdScript check-ebook-filename",

META.yml  view on Meta::CPAN

    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript check-archive-filename'
      version: '0.423'
    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript check-audio-filename'
      version: '0.423'
    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript check-backup-filename'
      version: '0.423'
    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript check-compressed-filename'
      version: '0.423'
    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript check-ebook-filename'
      version: '0.423'
    -

Makefile.PL  view on Meta::CPAN

my %WriteMakefileArgs = (
  "ABSTRACT" => "CLIs for Filename::*",
  "AUTHOR" => "perlancar <perlancar\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "App-FilenameUtils",
  "EXE_FILES" => [
    "script/check-archive-filename",
    "script/check-audio-filename",
    "script/check-backup-filename",
    "script/check-compressed-filename",
    "script/check-ebook-filename",
    "script/check-executable-filename",
    "script/check-image-filename",
    "script/check-media-filename",
    "script/check-video-filename"
  ],
  "LICENSE" => "perl",
  "NAME" => "App::FilenameUtils",
  "PREREQ_PM" => {

README  view on Meta::CPAN


SYNOPSIS
DESCRIPTION
    This distribution includes several utilities related to Filename::*
    modules:

    *   check-archive-filename

    *   check-audio-filename

    *   check-backup-filename

    *   check-compressed-filename

    *   check-ebook-filename

    *   check-executable-filename

    *   check-image-filename

    *   check-media-filename

README  view on Meta::CPAN

    a string containing error message, or 'OK' if status is 200. Third
    element (payload) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

    Return value: (bool|hash)

    Return false if no archive suffixes detected. Otherwise return a hash of
    information.

  check_backup_filename
    Usage:

     check_backup_filename(%args) -> [status, msg, payload, meta]

    Check whether filename indicates being a backup file.

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   ci => *bool* (default: 1)

        Whether to match case-insensitively.

    *   detail => *bool*

README  view on Meta::CPAN


    First element (status) is an integer containing HTTP status code (200
    means OK, 4xx caller error, 5xx function error). Second element (msg) is
    a string containing error message, or 'OK' if status is 200. Third
    element (payload) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

    Return value: (bool|hash)

    Return false if not detected as backup name. Otherwise return a hash,
    which may contain these keys: "original_filename". In the future there
    will be extra information returned, e.g. editor name (if filename
    indicates backup from certain backup program), date (if filename
    contains date information), and so on.

  check_compressed_filename
    Usage:

     check_compressed_filename(%args) -> [status, msg, payload, meta]

    Check whether filename indicates being compressed.

    This function is not exported.

dist.ini  view on Meta::CPAN

[GenPericmdScript / GenPericmdScript check-archive-filename]
url=/App/FilenameUtils/check_archive_filename
read_env=0
read_config=0

[GenPericmdScript / GenPericmdScript check-audio-filename]
url=/App/FilenameUtils/check_audio_filename
read_env=0
read_config=0

[GenPericmdScript / GenPericmdScript check-backup-filename]
url=/App/FilenameUtils/check_backup_filename
read_env=0
read_config=0

[GenPericmdScript / GenPericmdScript check-compressed-filename]
url=/App/FilenameUtils/check_compressed_filename
read_env=0
read_config=0

[GenPericmdScript / GenPericmdScript check-ebook-filename]
url=/App/FilenameUtils/check_ebook_filename

lib/App/FilenameUtils.pm  view on Meta::CPAN

    modify_meta => sub {
        $_[0]{result_naked} = 0;
        # XXX we should adjust the examples instead
        delete $_[0]{examples};
    },
    wrap_code => _gen_wrapper('an audio file'),
);

require Filename::Backup;
gen_modified_sub(
    base_name => 'Filename::Backup::check_backup_filename',
    add_args => {
        %argsopt,
    },
    modify_meta => sub {
        $_[0]{result_naked} = 0;
        # XXX we should adjust the examples instead
        delete $_[0]{examples};
    },
    wrap_code => _gen_wrapper('a backup file'),
);

require Filename::Compressed;
gen_modified_sub(
    base_name => 'Filename::Compressed::check_compressed_filename',
    add_args => {
        %argsopt,
    },
    modify_meta => sub {
        $_[0]{result_naked} = 0;

lib/App/FilenameUtils.pm  view on Meta::CPAN

=head1 DESCRIPTION

This distribution includes several utilities related to Filename::* modules:

=over

=item * L<check-archive-filename>

=item * L<check-audio-filename>

=item * L<check-backup-filename>

=item * L<check-compressed-filename>

=item * L<check-ebook-filename>

=item * L<check-executable-filename>

=item * L<check-image-filename>

=item * L<check-media-filename>

lib/App/FilenameUtils.pm  view on Meta::CPAN

that contains extra information.

Return value:  (bool|hash)


Return false if no archive suffixes detected. Otherwise return a hash of
information.



=head2 check_backup_filename

Usage:

 check_backup_filename(%args) -> [status, msg, payload, meta]

Check whether filename indicates being a backup file.

This function is not exported.

Arguments ('*' denotes required arguments):

=over 4

=item * B<ci> => I<bool> (default: 1)

Whether to match case-insensitively.

lib/App/FilenameUtils.pm  view on Meta::CPAN

First element (status) is an integer containing HTTP status code
(200 means OK, 4xx caller error, 5xx function error). Second element
(msg) is a string containing error message, or 'OK' if status is
200. Third element (payload) is optional, the actual result. Fourth
element (meta) is called result metadata and is optional, a hash
that contains extra information.

Return value:  (bool|hash)


Return false if not detected as backup name. Otherwise return a hash, which may
contain these keys: C<original_filename>. In the future there will be extra
information returned, e.g. editor name (if filename indicates backup from
certain backup program), date (if filename contains date information), and so
on.



=head2 check_compressed_filename

Usage:

 check_compressed_filename(%args) -> [status, msg, payload, meta]

script/check-backup-filename  view on Meta::CPAN

#!perl

# Note: This script is a CLI for Riap function /App/FilenameUtils/check_backup_filename
# and generated automatically using Perinci::CmdLine::Gen version 0.497

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2020-10-21'; # DATE
our $DIST = 'App-FilenameUtils'; # DIST
our $VERSION = '0.002'; # VERSION

use 5.010001;
use strict;
use warnings;

use Perinci::CmdLine::Any;

my $cmdline = Perinci::CmdLine::Any->new(
    url => "/App/FilenameUtils/check_backup_filename",
    program_name => "check-backup-filename",
    read_config => 0,
    read_env => 0,
);

$cmdline->run;

# ABSTRACT: Check whether filename indicates being a backup file
# PODNAME: check-backup-filename

__END__

=pod

=encoding UTF-8

=head1 NAME

check-backup-filename - Check whether filename indicates being a backup file

=head1 VERSION

This document describes version 0.002 of check-backup-filename (from Perl distribution App-FilenameUtils), released on 2020-10-21.

=head1 SYNOPSIS

Usage:

 % check-backup-filename [--ci] [--detail] [--format=name] [--json] [-l]
     [--(no)naked-res] [--no-ci] [--no-detail] [--no-quiet] [--noci]
     [--nodetail] [--noquiet] [--page-result[=program]] [-q] [--quiet]
     <filename>

=head1 DESCRIPTION

=head1 OPTIONS

C<*> marks required options.

script/check-backup-filename  view on Meta::CPAN


=head1 COMPLETION

This script has shell tab completion capability with support for several
shells.

=head2 bash

To activate bash completion for this script, put:

 complete -C check-backup-filename check-backup-filename

in your bash startup (e.g. F<~/.bashrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is recommended, however, that you install modules using L<cpanm-shcompgen>
which can activate shell completion for scripts immediately.

=head2 tcsh

To activate tcsh completion for this script, put:

 complete check-backup-filename 'p/*/`check-backup-filename`/'

in your tcsh startup (e.g. F<~/.tcshrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is also recommended to install L<shcompgen> (see above).

=head2 other shells

For fish and zsh, install L<shcompgen> as described above.

t/00-compile.t  view on Meta::CPAN


plan tests => 10 + ($ENV{AUTHOR_TESTING} ? 1 : 0);

my @module_files = (
    'App/FilenameUtils.pm'
);

my @scripts = (
    'script/check-archive-filename',
    'script/check-audio-filename',
    'script/check-backup-filename',
    'script/check-compressed-filename',
    'script/check-ebook-filename',
    'script/check-executable-filename',
    'script/check-image-filename',
    'script/check-media-filename',
    'script/check-video-filename'
);

# no fake home requested

t/author-critic.t  view on Meta::CPAN

}


use strict;
use warnings;

# this test was generated with Dist::Zilla::Plugin::Test::Perl::Critic::Subset 3.001.005

use Test::Perl::Critic (-profile => "") x!! -e "";

my $filenames = ['lib/App/FilenameUtils.pm','script/check-archive-filename','script/check-audio-filename','script/check-backup-filename','script/check-compressed-filename','script/check-ebook-filename','script/check-executable-filename','script/check...
unless ($filenames && @$filenames) {
    $filenames = -d "blib" ? ["blib"] : ["lib"];
}

all_critic_ok(@$filenames);



( run in 1.485 second using v1.01-cache-2.11-cpan-49f99fa48dc )