leo / args

Toolkit for building command line interfaces
https://npmjs.com/args
MIT License
461 stars 30 forks source link

Feature: Modifiable`showVersion()` method #135

Open DRSDavidSoft opened 5 years ago

DRSDavidSoft commented 5 years ago

Feature Request

I would like to be able to use a custom showVersion() method, so I can also display the package name in addition to the version.

How about this?

args.showVersion = function(version, pkg) {
  return `${pkg} v${version}`
}

That would be so nice!


nb: I assume that you are already parsing the package version from package.json, so it'd be cool to also get the package name from it, and pass it to the function.