Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show more info in cpm --version #188

Merged
merged 2 commits into from Nov 28, 2020
Merged

Conversation

gfx
Copy link
Contributor

@gfx gfx commented Nov 27, 2020

resolve #187

it shows like:

$ perl -Mlib=local/lib/perl5 -Ilib -E 'use App::cpm::CLI; App::cpm::CLI->cmd_version'
cpm 0.994 (-e)
perl version v5.32.0 (/usr/local/Cellar/perl/5.32.0/bin/perl)

  %Config:
    archname=darwin-thread-multi-2level
    installsitelib=/usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0
    installsitebin=/usr/local/Cellar/perl/5.32.0/bin
    installman1dir=/usr/local/Cellar/perl/5.32.0/share/man/man1
    installman3dir=/usr/local/Cellar/perl/5.32.0/share/man/man3
    sitearchexp=/usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/darwin-thread-multi-2level
    sitelibexp=/usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0
    archlibexp=/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level
    privlibexp=/usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0
  %ENV:
  @INC:
    local/lib/perl5/5.32.0/darwin-thread-multi-2level
    local/lib/perl5/5.32.0
    local/lib/perl5/darwin-thread-multi-2level
    local/lib/perl5
    lib
    /usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0/darwin-thread-multi-2level
    /usr/local/Cellar/perl/5.32.0/lib/perl5/site_perl/5.32.0
    /usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0/darwin-thread-multi-2level
    /usr/local/Cellar/perl/5.32.0/lib/perl5/5.32.0
    /usr/local/lib/perl5/site_perl/5.32.0

This is copied from cpanminus: https://github.com/miyagawa/cpanminus/blob/devel/Menlo-Legacy/lib/Menlo/CLI/Compat.pm#L568-L591

@@ -222,6 +222,25 @@ sub cmd_version {
if ($App::cpm::GIT_DESCRIBE) {
print "This is a self-contained version, $App::cpm::GIT_DESCRIBE ($App::cpm::GIT_URL)\n";
}

print "perl version $^V ($^X)\n\n";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace $^V by $]?
On perl 5.8, $^V is a v-string so that it is not printable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. I think 7f60596 is also okay.

@skaji skaji merged commit 2308492 into skaji:master Nov 28, 2020
@skaji
Copy link
Owner

skaji commented Nov 28, 2020

@gfx gfx deleted the show_more_info_in_version branch November 28, 2020 11:42
@gfx
Copy link
Contributor Author

gfx commented Nov 28, 2020

Thanks! I also waiting for homebrew's package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: more info in --version like cpanm --version
2 participants