preaction / Statocles

Static website CMS
http://preaction.me/statocles
Other
84 stars 33 forks source link

Add options for optional include directories #597

Closed ferki closed 4 years ago

ferki commented 4 years ago

This PR adds support for an optional --include CLI option, as well as a related --lib option for convenience.

Context: when Statocles functionality needs to be extended e.g. via custom plugins, then those modules somehow should be discoverable via @INC.

One approach could be to manipulate the contents of the PERL5LIB environment variable, but that often felt like a workaround, especially if this is only needed in a few selected projects instead of globally.

I decided to play around with adding a command line option for that, and since I always had to include ./lib only, I added a convenience wrapper for that use case too.

Please review the changes, and let me know if this sounds useful, and if yes, whether I should change anything before merging :)

preaction commented 4 years ago

Thanks! I always like having -l and -I options available to me.