jmacdotorg / plerd

Ultralight Dropbox-friendly Markdown-based blogging.
MIT License
112 stars 21 forks source link

plerdall --version should be a thing #47

Open taskboy3000 opened 4 years ago

taskboy3000 commented 4 years ago

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