Skip to content

Commit

Permalink
require params + help & options
Browse files Browse the repository at this point in the history
  • Loading branch information
kodi committed Aug 25, 2019
1 parent f386be1 commit 7d95111
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
25 changes: 21 additions & 4 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ const Tail = require('tail').Tail;

// CLI Stuff
const cli = meow(`
Uage: test
_____ _
/ ____| | |
| (___ _ __ | | _____ __
\\___ \\| '_ \\| |/ _ \\ \\/ /
____) | |_) | | __/> <
|_____/| .__/|_|\\___/_/\\_\\
| |
|_|
Usage:
$ splex [options] file1 file 2 fileX
Options:
--table -t print as table rows
`, {
flags: {
table: {
Expand All @@ -17,11 +31,15 @@ Uage: test
}
});

if (cli.input.length === 0) {
console.log(chalk.red('Error:'), 'No files specified.');
console.log(chalk.yellow('Usage example:'),'splex [options] file1 file2 file3...');
cli.showHelp(2);
}
const termSize = process.stdout.columns;

let filenames = cli.input;

let listeners = {};

let colors = [
'red',
'green',
Expand All @@ -31,7 +49,6 @@ let colors = [
'cyan',
]

let filenames = cli.input;


// create index of fileName -> color
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "splex",
"version": "1.0.5",
"description": "Multi File Tail",
"description": "Splex - Stream and view multiple files at once",
"main": "cli.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 0"
Expand Down

0 comments on commit 7d95111

Please sign in to comment.