App-perlmv-scriptlet-add_prefix_datestamp
view release on metacpan or search on metacpan
organize documents. There is file modification time supplied by the
filesystem, but this information does not survive through git repository
or sharing across the web/mobile application. Hence putting the
information in the filename.
SCRIPTLET ARGUMENTS
Arguments can be passed using the "-a" ("--arg") perlmv option, e.g. "-a
name=val".
avoid_duplicate_prefix
Avoid adding prefix when filename already has prefix that looks like
datestamp (1xxxxxxx- to 2xxxxxxx).
date
Use this date instead of file's modification time.
prefix_format
Specify datestamp format, in the form of strftime() template.
The default format is "%Y%m%d-" or "%Y%m%dT%H%M%S-" if you enable the
"with_time" option. But you can customize it here.
lib/App/perlmv/scriptlet/add_prefix_datestamp.pm view on Meta::CPAN
}
our $SCRIPTLET = {
summary => 'Add datestamp prefix (YYYYMMDD-) to filenames, using files\' modification time as date',
args => {
date => {
summary => "Use this date instead of file's modification time",
schema => 'date*',
},
avoid_duplicate_prefix => {
summary => 'Avoid adding prefix when filename already has prefix that looks like datestamp (1xxxxxxx- to 2xxxxxxx)',
schema => 'bool*',
},
prefix_regex => {
summary => 'Specify how existing datestamp prefix should be recognized',
schema => 're_from_str',
description => <<'_',
This regex is used to check for the existence of datestamp (if you use the
`avoid_duplicate_prefix` option. The default is `qr/^\d{8}(?:T\d{6})?-/` but if
your existing datestamps are in different syntax you can accommodate them here.
lib/App/perlmv/scriptlet/add_prefix_datestamp.pm view on Meta::CPAN
organize documents. There is file modification time supplied by the filesystem,
but this information does not survive through git repository or sharing across
the web/mobile application. Hence putting the information in the filename.
=head1 SCRIPTLET ARGUMENTS
Arguments can be passed using the C<-a> (C<--arg>) L<perlmv> option, e.g. C<< -a name=val >>.
=head2 avoid_duplicate_prefix
Avoid adding prefix when filename already has prefix that looks like datestamp (1xxxxxxx- to 2xxxxxxx).
=head2 date
Use this date instead of file's modification time.
=head2 prefix_format
Specify datestamp format, in the form of strftime() template.
The default format is C<"%Y%m%d-"> or C<"%Y%m%dT%H%M%S-"> if you enable the
( run in 0.544 second using v1.01-cache-2.11-cpan-64827b87656 )