Vimana::Command::Install - install a vim plugin package.


Vimana documentation Contained in the Vimana distribution.

Index


Code Index:

NAME

Top

Vimana::Command::Install - install a vim plugin package.

SYNOPSIS

Top

    $ vimana install [plugin]

OPTIONS

Top

    -v    : verbose

    -f    : force install

    -r    : runtime path

DESCRIPTION

Top


Vimana documentation Contained in the Vimana distribution.

use warnings;
use strict;
package Vimana::Command::Install;
use base qw(App::CLI::Command);
use URI;
use LWP::Simple qw();
use File::Path qw(rmtree);
use Cwd;

require Vimana::VimOnline;
require Vimana::VimOnline::ScriptPage;
use Vimana::Util;
use Vimana::Record;
use Vimana::Logger;

sub options { (
        'd|dry-run'           => 'dry_run',
        'v|verbose'           => 'verbose',
        'y|yes'               => 'assume_yes',
        'c|cleanup'           => 'cleanup',

        # when not installing plugin from vim.org. (eg, from git or svn or local filepath)
        'n|name=s'              => 'package_name',

        # XXX: auto-install should optional and not by default.
        'ai|auto-install'     => 'auto_install', 
        'mi|makefile-install' => 'makefile_install',
        'r|runtime-path=s'    => 'runtime_path',
) }

use Vimana::Installer;

sub run {
    my ( $cmd, $arg ) = @_;
    if( $arg =~ m{^https?://} ) {
        Vimana::Installer->install_from_url( $arg , $cmd );
    }
    elsif( $arg =~ m{^(?:git|svn):} ) {
        Vimana::Installer->install_from_vcs( $arg , $cmd );
    }
    elsif( -f $arg or -d $arg ) {  # is a file or directory
        Vimana::Installer->install_from_path( $arg , $cmd );
    }
    else {
        Vimana::Installer->install( $arg , $cmd ); # from vim.org
    }
}

1;
__END__