feat(cli): Add CLI support with command parsing and version display
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@git.zone/tspm',
|
||||
version: '1.2.0',
|
||||
version: '1.3.0',
|
||||
description: 'a no fuzz process manager'
|
||||
}
|
||||
|
21
ts/cli.ts
Normal file
21
ts/cli.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import * as paths from './paths.js';
|
||||
|
||||
export const run = async () => {
|
||||
const tspmProjectinfo = new plugins.projectinfo.ProjectInfo(paths.packageDir);
|
||||
|
||||
const smartcliInstance = new plugins.smartcli.Smartcli();
|
||||
smartcliInstance.addVersion(tspmProjectinfo.npm.version);
|
||||
|
||||
smartcliInstance.standardCommand().subscribe({
|
||||
next: (argvArg) => {
|
||||
console.log(`Please specify a command.`)
|
||||
},
|
||||
});
|
||||
|
||||
smartcliInstance.addCommand('restart').subscribe({
|
||||
|
||||
})
|
||||
|
||||
smartcliInstance.startParse();
|
||||
}
|
@ -1,2 +1,11 @@
|
||||
export * from './classes.tspm.js';
|
||||
export * from './classes.processmonitor.js';
|
||||
|
||||
import * as cli from './cli.js';
|
||||
|
||||
/**
|
||||
* called to run as cli
|
||||
*/
|
||||
export const runCli = async () => {
|
||||
await cli.run();
|
||||
}
|
@ -8,10 +8,12 @@ export {
|
||||
}
|
||||
|
||||
// @push.rocks scope
|
||||
import * as projectinfo from '@push.rocks/projectinfo';
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
import * as smartcli from '@push.rocks/smartcli';
|
||||
|
||||
export {
|
||||
projectinfo,
|
||||
smartpath,
|
||||
smartcli,
|
||||
}
|
||||
|
Reference in New Issue
Block a user