I'm not having any fun
This commit is contained in:
+2
-20
@@ -1,21 +1,3 @@
|
|||||||
import { Command, program } from "commander";
|
import { RUN_CLI } from "./src/interface/cli";
|
||||||
import { SC_CONFIG } from "./src/interface/config";
|
|
||||||
|
|
||||||
const c = new Command();
|
RUN_CLI()
|
||||||
|
|
||||||
export function RUN_CLI(){
|
|
||||||
c
|
|
||||||
.name('soupclown')
|
|
||||||
.description('Soupclown system')
|
|
||||||
.option('--showConfig', 'display the configured config')
|
|
||||||
.parse();
|
|
||||||
|
|
||||||
const options = c.opts();
|
|
||||||
|
|
||||||
if(options.showConfig){
|
|
||||||
console.log(JSON.stringify(SC_CONFIG, null, 2))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RUN_CLI();
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { Command, program } from "commander";
|
||||||
|
import { SC_CONFIG } from "./config";
|
||||||
|
|
||||||
|
export function RUN_CLI(){
|
||||||
|
const c = new Command();
|
||||||
|
|
||||||
|
c
|
||||||
|
.name('soupclown')
|
||||||
|
.description('Soupclown system')
|
||||||
|
|
||||||
|
c
|
||||||
|
.command('host <action>')
|
||||||
|
.action((action, opts) => {
|
||||||
|
console.log(opts)
|
||||||
|
switch(action){
|
||||||
|
|
||||||
|
case 'init':
|
||||||
|
console.log('init action!')
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
console.log('fool!')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
c.parse();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user