aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/index.js b/bin/index.js
index 6d87d1d..b2a3f36 100644
--- a/bin/index.js
+++ b/bin/index.js
@@ -6,6 +6,8 @@ const boxen = require("boxen");
const chalk = require("chalk");
const packageInfo = require('./../package.json');
const math = require('mathjs');
+const fs = require('fs');
+const path = require('path');
const infoMessage = {
getIntroductoryMessage: () => {
// If the command is run without any options we will show the about screen
@@ -82,3 +84,9 @@ Command Help Example:
if (args.info || Object.keys(args).length < 3 && !args._.length) {
infoMessage.getIntroductoryMessage();
}
+
+if (args.license && Object.keys(args).length === 3 && !args._.length) {
+ const filePath = path.join(__dirname, '../LICENSE');
+ const licenseContents = fs.readFileSync(filePath);
+ console.log(licenseContents.toString());
+}