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

plerdall --version should be a thing #47

Open
taskboy3000 opened this issue Jun 16, 2020 · 0 comments
Open

plerdall --version should be a thing #47

taskboy3000 opened this issue Jun 16, 2020 · 0 comments

Comments

@taskboy3000
Copy link
Collaborator

Sometimes, it is nice to know which version of plerd is running. plerdall and plerdwatcher (if that continues to be a thing) should consider implementing the common flag --version.

Ideally, this version would match Makefile.PL -> $WriteMakefileArgs{VERSION}. That is going to be a non-started to implement, but if lib/Plerd.pm had an our $VERSION='XX.YY' package variable, Makefile.PL can get it with:

Insert before call to WriteMakefile on line 54

(Sorry, but Perl and markdown are fighting.)


use lib ('./lib'); # or use FindBin to construct an absolute path
use Plerd;

$WriteMakefileArgs{VERSION} = $Plerd::VERSION;

This makes the implementation of --version within plerdall trivial:

Add after my $init_path;


my $version_message = 0;

Add to GetOptions() call


'version' => $version_message,

Add before if ( defined $init_path ) {


if ($version_message) {
printf("plerdall is part of Plerd %s\n", $Plerd::VERSION);
exit(0);
}

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

No branches or pull requests

1 participant