-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nishant Mendiratta
authored and
Nishant Mendiratta
committed
Sep 23, 2023
1 parent
07109df
commit 3c369af
Showing
4 changed files
with
155 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
module.exports = { showHelp: showHelp, parseSentence: parseSentence }; | ||
const inputMessage = (chalk) => `${chalk.yellow("Usage:")} ${chalk.red("uglifymyjs -s /absolute-path-to-source-js-file.js")}` | ||
const outputMessage = (chalk) => `${chalk.yellow("\nOutput:")} ${chalk.blue("'main.bundle.min.js' is generated in the same folder.")}` | ||
const usage = (chalk, boxen) => boxen(`${inputMessage(chalk)}${outputMessage(chalk)}`); | ||
|
||
const usage = "\nUsage: uglifymyjs -s <absolute-path-to-source-js-file-to-be-minified-and-uglified>"; | ||
|
||
function showHelp() { | ||
console.log(usage); | ||
function showHelp(chalk, boxen) { | ||
console.log(usage(chalk, boxen)); | ||
console.log('\nOptions:\r') | ||
console.log('\t--version\t ' + 'Show version number.' + '\t\t' + '[boolean]\r') | ||
console.log('\t-s, --source\t' + ' ' + 'Absolute path of the source javascript file' + '\t\t' + '[string]\r') | ||
console.log('\t--help\t\t ' + 'Show help.' + '\t\t\t' + '[boolean]\n') | ||
} | ||
|
||
function parseSentence(words) { | ||
var sentence = ""; | ||
for(var i = 1; i < words.length; i++) { | ||
sentence = sentence + words[i] + " "; | ||
} | ||
} | ||
} | ||
|
||
module.exports = { showHelp, usage, outputMessage }; |
Oops, something went wrong.