Skip to content

Commit

Permalink
Created cli-tool for Yttria project tooling.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Aug 20, 2023
1 parent d2eae12 commit 473c55a
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions cli-tool/cli-tool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { hideBin } from 'yargs/helpers';

import colors from 'colors';
import yargs from 'yargs';

function printBanner(args: any) {
console.log();
console.log('┌──────────────────────────────────────┐');
console.log('│ │');

// Here comes the wizardry.
console.log(
'│' + ' ▀▀▌' + '───────'.gray + '▐▀▀' + ' │\n' +
'│' + ' ▄▀' + '░'.blue + '◌'.bold + '░░░░░░░'.blue + '▀▄' + ' ┓┏ •'.cyan.bold + ' │\n' +
'│' + ' ▐' + '░░'.blue + '◌'.bold + '░'.blue + '▄▀██▄█' + '░░░'.blue + '▌' + ' ┗┫ ╋ ╋ ┏┓ ┓ ┏┓'.cyan.bold + ' │\n' +
'│' + ' ▐' + '░░░'.blue + '▀████▀▄' + '░░░'.blue + '▌' + ' ┗┛ ┗ ┗ ┛ ┗ ┗┻'.cyan.bold + ' │\n' +
'│' + ' ▐' + '░░░░░░░░░░░░░'.blue + '▌ ' + ' CLI Tool '.bgRed + ' │\n' +
'│' + ' ▀▄▄▄▄▄▄▄▄▄▄▄▀' + ' v0.0.1'.yellow.bold + ' │\n' +
'│ │'
);

if(args.help || args.h ||
args._.length == 0) {

console.log(
'├──────────────────────────────────────┤\n' +
'│ Use ' + '-h'.italic + ' to print help screen. │\n' +
'│ │\n' +
'│ For more details, visit: │\n' +
'│ ' + 'https://nthnn.github.io/yttria-lang'.underline + ' │\n' +
'└──────────────────────────────────────┘\n'
);
}
else console.log('└──────────────────────────────────────┘\n');
}

function main(): void {
const args = yargs(hideBin(process.argv))
.option('help', {
alias: 'h',
type: 'boolean'
})
.showHelp(()=> { })
.exitProcess(false)
.argv;

colors.enable();
printBanner(args);
}

main();

0 comments on commit 473c55a

Please sign in to comment.