Skip to content

plerdall --version should be a thing #47

Description

@taskboy3000

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);
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions