App-pause
view release on metacpan or search on metacpan
- [build] Rebuild with WWW::PAUSE::Simple 0.448 to support cleaning
up dev releases.
- UPDATE: this release is broken.
0.653 2020-02-18 Released-By: PERLANCAR; Urgency: medium
- Write access log file (currently hard-coded path in
~/pause-access.log or ./pause-access.log). Currently
WWW::PAUSE::Simple produces access log for these actions: upload,
delete, undelete.
0.652 2019-06-05 Released-By: PERLANCAR
- Update to WWW::PAUSE::Simple 0.444 (use exponential backoff
strategy for retry, deprecate --retry-delay, add
--retry-max-delay).
- [Removed features] To make things simpler and more orthogonal, remove
aliases list (for ls), delete (for rm); rename subcommands list-dists
-> ls-dists, list-mods -> ls-mods.
0.55 2016-06-02 Released-By: PERLANCAR
- [Bugfix] Typo in attribute name (config_filenames -> config_filename).
- [build][bundle] Update to WWW::PAUSE::Simple 0.30 (warn after each
file fails to be uploaded).
0.54 2016-04-20 Released-By: PERLANCAR
- No functional changes.
- [build] Rebuild with updated Dist::Zilla::Plugin::GenShellCompletion
so we avoid ConfigureRequires to Perl::osnames.
0.48 2015-09-18 Released-By: PERLANCAR
- No functional changes.
- Rebuild with updated Complete::* modules which has fuzzy matching.
0.47 2015-09-10 Released-By: PERLANCAR
- No changes, re-upload.
0.46 2015-09-10 Released-By: PERLANCAR
- Add subcommand: list-mods to view permissions.
0.45 2015-07-28 Released-By: PERLANCAR
- No functional changes.
0.42 2015-07-07 Released-By: PERLANCAR
- Bump packed module WWW::PAUSE::Simple to 0.24 (fix undef warnings).
0.41 2015-07-07 Released-By: PERLANCAR
- Bump packed module WWW::PAUSE::Simple to 0.23 (dry-run support &
--group-delay for upload).
0.40 2015-07-06 Released-By: PERLANCAR
- No functional changes.
- [build] Build fixes: put $DIST in App/pause.pm instead of bin/pause
(the one which we will use later), use update DZP:Depak 0.10 which
fixes typo.
lib/App/pause.pm view on Meta::CPAN
our $DIST = 'App-pause'; # DIST
our $VERSION = '0.662'; # VERSION
our %cli_attrs = do {
my $p = '/WWW/PAUSE/Simple/';
(
script_summary => 'A CLI for PAUSE',
url => '/WWW/PAUSE/Simple/',
subcommands => {
upload => { url => "${p}upload_files" },
ls => { url => "${p}list_files" },
"ls-dists" => { url => "${p}list_dists" },
"ls-mods" => { url => "${p}list_modules" },
rm => { url => "${p}delete_files" },
undelete => { url => "${p}undelete_files" },
reindex => { url => "${p}reindex_files" },
#password => { url => "${p}set_password" },
#'account-info' => { url => "${p}set_account_info" },
cleanup => { url => "${p}delete_old_releases" },
},
script/pause view on Meta::CPAN
#!perl
### begin code_after_shebang
### end code_after_shebang
# PERICMD_INLINE_SCRIPT: {"code_add_extra_log_outputs":"...","code_before_enable_logging":"...","config_filename":["pause.conf"],"env_name":"PAUSE_OPT","include":[],"log":1,"pack_deps":0,"pod":0,"read_config":1,"read_env":1,"script_name":"pause","scr...
# This script is generated by Perinci::CmdLine::Inline version 0.554 on Mon Feb 24 11:35:30 2025.
# Rinci metadata taken from these modules: WWW::PAUSE::Simple 0.457
# You probably should not manually edit this file.
## no critic: TestingAndDebugging::RequireUseStrict
# PODNAME: pause
script/pause view on Meta::CPAN
# load modules
### declare global variables
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2025-05-15'; # DATE
our $DIST = 'App-pause'; # DIST
our $VERSION = '0.662'; # VERSION
my $_pci_metas = do{my$var={cleanup=>{args=>{detail=>{cmdline_aliases=>{l=>{}},schema=>["bool",{}],summary=>"Whether to return detailed records"},exclude_dists=>{schema=>["array",{of=>["str",{req=>1}],req=>1}],summary=>"Exclude specified distribution...
our $_pci_log_outputs = {};
our $_pci_meta_result_stream = 0;
our $_pci_meta_result_type;
our $_pci_meta_result_type_is_simple;
our $_pci_meta_skip_format = 0;
our $_pci_r = {naked_res=>0,read_config=>1,read_env=>1,subcommand_name=>""};
our %_pci_args;
### begin code_before_enable_logging
script/pause view on Meta::CPAN
### begin code_before_parse_cmdline_options
### end code_before_parse_cmdline_options
### get arguments (from config file, env, command-line args
{
my %mentioned_args;
require Getopt::Long::EvenLess;
log_trace("Parsing command-line arguments ...");
require Getopt::Long::Subcommand;
my $help_msg = "pause - A CLI for PAUSE\n\nUsage:\n pause --help (or -h, -?)\n pause --subcommands\n pause --version (or -v)\n pause [--cmd=subcommand_name] [(--config-path=path)+|--no-config]\n [--config-profile=profile] [--debug] [--format=n...
my $go_spec1 = {
'cmd=s' => sub { $_[2]{subcommand} = [$_[1]]; $_pci_r->{subcommand_name} = $_[1]; },
'config-path=s@' => sub { $_pci_r->{config_paths} //= []; push @{ $_pci_r->{config_paths} }, $_[1]; },
'config-profile=s' => sub { $_pci_r->{config_profile} = $_[1]; },
'debug' => sub { require Log::ger::Util; Log::ger::Util::set_level("debug"); $_pci_r->{log_level} = "debug"; },
'format=s' => sub { $_pci_r->{format} = $_[1]; },
'help|h|?' => sub { my $sc_name = $_pci_r->{subcommand_name}; my $first_non_opt_arg; for (@ARGV) { next if /^-/; $first_non_opt_arg = $_; last } if (!length $sc_name && defined $first_non_opt_arg) { $sc_name = $first_non_opt_arg } if (!length $sc_n...
'json' => sub { $_pci_r->{format} = (-t STDOUT) ? "json-pretty" : "json"; ## no critic InputOutput::ProhibitInteractiveTest
},
'log-level=s' => sub { if ($_[1] eq "trace") { require Log::ger::Util; Log::ger::Util::set_level("trace"); Log::ger::Output::Composite::set_level("trace") } if ($_[1] eq "debug") { require Log::ger::Util; Log::ger::Util::set_level("debug"); Log::ge...
'naked-res' => sub { $_pci_r->{naked_res} = 1; },
'no-config' => sub { $_pci_r->{read_config} = 0; },
'no-env' => sub { $_pci_r->{read_env} = 0; },
'no-naked-res|nonaked-res' => sub { $_pci_r->{naked_res} = 0; },
'page-result:s' => sub { $_pci_r->{page_result} = 1; },
'quiet' => sub { require Log::ger::Util; Log::ger::Util::set_level("error"); $_pci_r->{log_level} = "error"; },
'subcommands' => sub { print "Available subcommands:\n cleanup\n ls\n ls-dists\n ls-mods\n reindex\n rm\n undelete\n upload\n"; exit 0 },
'trace' => sub { require Log::ger::Util; Log::ger::Util::set_level("trace"); $_pci_r->{log_level} = "trace"; },
'verbose' => sub { require Log::ger::Util; Log::ger::Util::set_level("info" ); $_pci_r->{log_level} = "info" ; },
'version|v' => sub { no warnings 'once'; require WWW::PAUSE::Simple; print "pause version ", $main::VERSION // '?', ($main::DATE ? " ($main::DATE)" : ''), "\n"; print " Generated by Perinci::CmdLine::Inline version 0.554 (2022-01-16)\n"; exit 0 },
};
my $go_spec2 = {
options => {
'cmd=s' => {
handler => sub { $_[2]{subcommand} = [$_[1]]; $_pci_r->{subcommand_name} = $_[1]; },
},
'config-path=s@' => {
script/pause view on Meta::CPAN
handler => sub { $_pci_args{'password'} = $_[1]; },
},
'retries=s' => {
handler => sub { $_pci_args{'retries'} = $_[1]; },
},
'username=s' => {
handler => sub { $_pci_args{'username'} = $_[1]; },
},
},
},
'upload' => {
options => {
'delay=s' => {
handler => sub { $_pci_args{'delay'} = $_[1]; },
},
'file=s@' => {
handler => sub { if ($mentioned_args{'files'}++) { push @{ $_pci_args{'files'} }, $_[1] } else { $_pci_args{'files'} = [$_[1]] } },
},
'files-json=s' => {
handler => sub { $_pci_args{'files'} = _pci_json()->decode($_[1]); },
},
script/pause view on Meta::CPAN
require WWW::PAUSE::Simple;
eval { $_pci_r->{res} = WWW::PAUSE::Simple::delete_files(%_pci_args) };
if ($@) { die if $ENV{PERINCI_CMDLINE_INLINE_DEBUG_DIE}; $_pci_r->{res} = [500, "Function died: $@"] }
}
elsif ($sc_name eq "undelete") {
$_pci_meta_result_type = "";
require WWW::PAUSE::Simple;
eval { $_pci_r->{res} = WWW::PAUSE::Simple::undelete_files(%_pci_args) };
if ($@) { die if $ENV{PERINCI_CMDLINE_INLINE_DEBUG_DIE}; $_pci_r->{res} = [500, "Function died: $@"] }
}
elsif ($sc_name eq "upload") {
$_pci_meta_result_type = "";
require WWW::PAUSE::Simple;
eval { $_pci_r->{res} = WWW::PAUSE::Simple::upload_files(%_pci_args) };
if ($@) { die if $ENV{PERINCI_CMDLINE_INLINE_DEBUG_DIE}; $_pci_r->{res} = [500, "Function died: $@"] }
}
}
### format & display result
{
log_trace("Displaying result ...");
my $fh;
if ($_pci_r->{page_result} // $ENV{PAGE_RESULT} // $_pci_r->{res}[3]{"cmdline.page_result"}) {
script/pause view on Meta::CPAN
} # if date arg exists
# check required args
return [400, "Missing required argument: files"] unless exists $args->{"files"};
return [400, "Missing required value for argument: files"] if exists($args->{"files"}) && !defined($args->{"files"});
return [400, "Missing required value for argument: password"] if exists($args->{"password"}) && !defined($args->{"password"});
return [400, "Missing required value for argument: retries"] if exists($args->{"retries"}) && !defined($args->{"retries"});
return [400, "Missing required value for argument: username"] if exists($args->{"username"}) && !defined($args->{"username"});
_pci_err([500, "Extraneous command-line argument(s): ".join(", ", @check_argv)]) if @check_argv;
[200];
} elsif ($sc_name eq "upload") {
FILL_FROM_POS: {
1;
if (@ARGV > 0) { if (exists $args->{"files"}) { return [400, "You specified --file but also argument #0"]; } else { $args->{"files"} = [splice(@ARGV, 0)]; } }
}
my @check_argv = @ARGV;
# fill from cmdline_src
# fill defaults from "default" property and check against schema
no warnings ('void');
require Time::Duration::Parse::AsHash;
script/pause view on Meta::CPAN
This document describes version 0.662 of main (from Perl distribution App-pause), released on 2025-05-15.
=head1 SYNOPSIS
First create a config file C<~/pause.conf> containing:
username=<Your PAUSE ID>
password=<Your PAUSE password>
or if you have C<~/.pause> from L<cpan-upload>, C<pause> can read it too
(encrypted C<.pause> is currently not supported).
Then:
# upload one or more files
% pause upload Foo-Bar-0.12.tar.gz Baz-2.24.tar.gz
% pause upload Foo-Bar-0.12.tar.gz --subdir old/2014; # upload to a subdir
# list your files
% pause ls
% pause ls 'App-*'; # accept filenames/wildcard patterns, note: quote first
% pause ls -l ; # see file sizes/mtimes/etc instead of just names
# list your dists
% pause ls-dists
# delete files
script/pause view on Meta::CPAN
=head2 B<undelete>
Undelete files.
When a file is deleted, it is not immediately deleted but has
scheduled_for_deletion status for 72 hours, then deleted. During that time, the
file can be undeleted.
=head2 B<upload>
Upload file(s).
=head1 OPTIONS
C<*> marks required options.
=head2 Common options
=over
script/pause view on Meta::CPAN
=item B<--files-json>=I<s>
File names/wildcard patterns (JSON-encoded).
See C<--file>.
Can also be specified as the 1st command-line argument and onwards.
=back
=head2 Options for subcommand upload
=over
=item B<--delay>=I<s>
Pause a number of seconds between files.
If you upload a lot of files (e.g. 7-10 or more) at a time, the PAUSE indexer
currently might choke with SQLite database locking problem and thus fail to
index your releases. Giving a delay of say 2-3 minutes (120-180 seconds) between
files will alleviate this problem.
=item B<--file>=I<s@>*
File name/wildcard pattern.
Can also be specified as the 1st command-line argument and onwards.
script/pause view on Meta::CPAN
=head2 Configuration for subcommand rm
files (see --file)
protect_files (see --protect-file)
=head2 Configuration for subcommand undelete
files (see --file)
=head2 Configuration for subcommand upload
delay (see --delay)
files (see --file)
subdir (see --subdir)
=head1 ENVIRONMENT
=head2 PAUSE_OPT
String. Specify additional command-line options.
( run in 1.514 second using v1.01-cache-2.11-cpan-b16cb0d3907 )