Skip to content

Allow to define custom version function #58

@andresgutgon

Description

@andresgutgon

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:
image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions