From a72b7a7d8d450d32f0a26c6668d1d1b02b200ce9 Mon Sep 17 00:00:00 2001 From: selfisekai Date: Tue, 3 Dec 2019 17:27:54 +0100 Subject: [PATCH] add github repo link in `--version` flag --- bin/nc.js | 2 +- lib/services.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/nc.js b/bin/nc.js index 39d21f3..15767d3 100644 --- a/bin/nc.js +++ b/bin/nc.js @@ -6,7 +6,7 @@ const ora = require("ora"); const spinner = ora(); program - .version("0.0.1", "-v, --version") + .option("-v, --version", "Check the version of NodeCloud CLI") .option("-a, --about", "View about section of NodeCloud CLI") .option("-i, --init", "Initialize provider") .option("-t, --type ", "Type") diff --git a/lib/services.js b/lib/services.js index 6404e10..1234dab 100644 --- a/lib/services.js +++ b/lib/services.js @@ -17,6 +17,13 @@ const options = { }; function Services(program, spinner) { + if (!program.version) { + // no idea why this is the opposite, unlike other options + console.log( + "0.0.1\n" + + "GitHub repository: https://github.com/cloudlibz/nodecloud-cli" + ); + } if (program.about) { logofied("NodeCloud CLI"); }