-
Notifications
You must be signed in to change notification settings - Fork 0
/
familiar.js
32 lines (26 loc) · 978 Bytes
/
familiar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /usr/bin/env node
// --------------------------------------------------
// IMPORT MODULES
// --------------------------------------------------
// Vendor
const parseArgs = require( 'minimist' );
// Project
require( './lib/setup' );
const familiar = require( './lib/familiar' );
// --------------------------------------------------
// DECLARE VARS
// --------------------------------------------------
const args = process.argv.slice( 2 ) || [];
const command = args[ 0 ];
const options = parseArgs( args.slice( 1 ) );
// --------------------------------------------------
// PARSE ARGS
// --------------------------------------------------
switch ( command in familiar ) {
case true:
familiar[ args[ 0 ] ]( options );
break;
default:
console.log( 'Whoops! Looks like you ran the `familiar` command with missing or invalid arguments!'.error );
console.log( 'Run `familiar help` to see a list of available commands/options.' );
}