From 53da2fcfe980bb6a5ac7352f04b463858b5d7c95 Mon Sep 17 00:00:00 2001 From: delphinus Date: Tue, 19 Apr 2016 22:44:14 +0900 Subject: [PATCH] Add alias for plenv subcommands --- modules/perl/README.md | 31 +++++++++++++++++++++++++++++-- modules/perl/init.zsh | 37 ++++++++++++++++++++++++++++--------- 2 files changed, 57 insertions(+), 11 deletions(-) diff --git a/modules/perl/README.md b/modules/perl/README.md index f25d4a95..cc5a9d32 100644 --- a/modules/perl/README.md +++ b/modules/perl/README.md @@ -30,6 +30,14 @@ Perlbrew An alternative to the above is to use [Perlbrew][2], which allows for the management of multiple, isolated Perl installations in the home directory. +plenv +----- + +Yet another alternative is [plenv][3]. This is inspired from rbenv and enables +switching between multiple binary installations. + +The subcommands of plenv is similar with rbenv. + Aliases ------- @@ -51,6 +59,24 @@ Aliases - `plbu` uninstalls a Perl version. - `plbx` temporarily sets the Perl version to use. +### plenv + + - `plv` manages Perl environments. + - `plvc` List all available plenv commands. + - `plvl` Set or show the local application-specific Perl version. + - `plvg` Set or show the global Perl version. + - `plvs` Set or show the shell-specific Perl version. + - `plvi` Install a Perl version using the perl-build plugin. + - `plvu` Uninstall a specific Perl version. + - `plvr` Rehash plenv shims (run this after installing executables). + - `plvv` Show the current Perl version and its origin. + - `plvV` List all Perl versions available to plenv. + - `plvw` Display the full path to an executable. + - `plvW` List all Perl versions that contain the given executable. + - `plvm` List cpan modules in current perl. + - `plvM` Migrate cpan modules from other version. + - `plvI` Install cpanm. + Functions --------- @@ -72,10 +98,11 @@ Then add `$perl_info[version]` to `$PROMPT` or `$RPROMPT` and call Authors ------- -*The authors of this module should be contacted via the [issue tracker][3].* +*The authors of this module should be contacted via the [issue tracker][4].* - [Sorin Ionescu](https://github.com/sorin-ionescu) [1]: http://www.perl.org [2]: http://perlbrew.pl -[3]: https://github.com/sorin-ionescu/prezto/issues +[3]: https://github.com/tokuhirom/plenv +[4]: https://github.com/sorin-ionescu/prezto/issues diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index a8d56031..59da1524 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -41,12 +41,31 @@ alias pld='perldoc' alias ple='perl -wlne' # Perlbrew -alias plb='perlbrew' -alias plba='perlbrew available' -alias plbi='perlbrew install' -alias plbl='perlbrew list' -alias plbo='perlbrew off' -alias plbO='perlbrew switch-off' -alias plbs='perlbrew switch' -alias plbu='perlbrew use' -alias plbx='perlbrew uninstall' +if (( $+commands[perlbrew] )); then + alias plb='perlbrew' + alias plba='perlbrew available' + alias plbi='perlbrew install' + alias plbl='perlbrew list' + alias plbo='perlbrew off' + alias plbO='perlbrew switch-off' + alias plbs='perlbrew switch' + alias plbu='perlbrew use' + alias plbx='perlbrew uninstall' + +elif (( $+commands[plenv] )); then + alias plv='plenv' + alias plvc='plenv commands' + alias plvl='plenv local' + alias plvg='plenv global' + alias plvs='plenv shell' + alias plvi='plenv install' + alias plvu='plenv uninstall' + alias plvr='plenv rehash' + alias plvv='plenv version' + alias plvV='plenv versions' + alias plvw='plenv which' + alias plvW='plenv whence' + alias plvm='plenv list-modules' + alias plvM='plenv migrate-modules' + alias plvI='plenv install-cpanm' +fi