Allow to define custom version function
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
What?
As far as I can see to define CLI version you do this
import sade from 'sade'
const CLI = sade('latitude')
CLI.version('1.2.3')
Then that shows
latitude 1.2.3
It's fine but our CLI install a nodejs server that we call the app. We would like to show both versions. CLI and app versions. Something like this:
So far we manage to hack sade by overriding _version private function
CLI['_version'] = versionCommand
But this is not ideal. I think it would be nice if .version method allows a function
CLI.version(versionCommand)
I'm open to make this change if you consider is a good idea.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the public .version method and the existing _version implementation, which the issue identifies as the current customization point. Trace how the CLI version is displayed, then verify that passing a function supports the requested CLI and app version output while preserving the existing string form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100