App-Sky

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.4.2       2020-08-14
    - More fixes to use of Clipboard.pm .
    - Allow -x / -- copy to be used after "up" or "up-r".
    - Code cleanup.

0.4.1       2019-01-31
    - Fix the --copy functionality.

0.4.0       2019-01-31
    - Add the --copy / -x flag to copy the upload URL to the clipboard.

v0.2.1      2014-10-17
    - Document the "up-r" command.

v0.2.0      2014-10-16
    - Add the "up-r" sub-command to upload sub-dirs.

v0.0.7      2014-02-02
    - Fix the =encoding directives globally.
        - Single UTF-8 one.

lib/App/Sky/CmdLine.pm  view on Meta::CPAN



sub _basic_help
{
    my ($self) = @_;

    print <<'EOF';
sky upload /path/to/myfile.txt
sky up-r /path/to/directory

Specifying --copy or -x will copy the URL to the clipboard.
EOF

    exit(0);
}

sub _basic_usage
{
    my ($self) = @_;

    print "Usage: sky [up|upload] /path/to/myfile.txt\n";
    exit(-1);
}

sub _is_copy_to_clipboard
{
    my ( $self, $flag ) = @_;

    return ( $flag =~ /\A(--copy|-x)\z/ );
}

sub _shift
{
    my $self = shift;

lib/App/Sky/CmdLine.pm  view on Meta::CPAN

        return $self->_basic_usage();
    }

    my $verb = shift( @{ $self->argv() } );

    if ( ( $verb eq '--help' ) or ( $verb eq '-h' ) )
    {
        return $self->_basic_help();
    }

    if ( $self->_is_copy_to_clipboard($verb) )
    {
        $copy = 1;

        $verb = shift( @{ $self->argv() } );
    }

    my $_calc_manager = sub {
        my $dist_config_dir =
            File::HomeDir->my_dist_config( 'App-Sky', { create => 1 }, );

lib/App/Sky/CmdLine.pm  view on Meta::CPAN


    # GetOptionsFromArray(
    #     $self->argv(),
    # );

    my $filename = $self->_shift();

ARGS_LOOP:
    while ( $filename =~ /\A-/ )
    {
        if ( $self->_is_copy_to_clipboard($filename) )
        {
            $copy     = 1;
            $filename = $self->_shift();
        }
        elsif ( $filename eq '--' )
        {
            $filename = $self->_shift();
            last ARGS_LOOP;
        }
        else



( run in 1.302 second using v1.01-cache-2.11-cpan-2398b32b56e )