UNPKG

690 BPlain TextView Raw
1'use strict';
2let userArgs = process.argv.slice(2);
3
4import Program from './lib/commander';
5import Commands from './commands';
6
7console.log(process.argv[1]);
8
9/**
10 * APB CLI Class
11 * @public
12 **/
13export class ApbCli {
14 constructor(
15 public userArgs: any,
16 public commands: any
17 ) {
18 Commands.fromData({
19 userArgs: userArgs,
20 commands: commands,
21 program: new Program()
22 });
23 }
24
25 /**
26 * Static Function
27 **/
28 static fromData(data: any): ApbCli {
29 return new ApbCli(
30 data.userArgs ? data.userArgs : null,
31 data.commands ? data.commands : null
32 );
33 }
34}
35
36export default ApbCli.fromData({
37 userArgs: userArgs,
38 commands: userArgs[0]
39});