mirror of
https://github.com/sern-handler/cli
synced 2026-06-06 01:16:53 +00:00
feat: added help command
This commit is contained in:
6
src/commands/help.js
Normal file
6
src/commands/help.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export default function () {
|
||||
console.log(
|
||||
'This is sern cli help section\n\n' +
|
||||
'Fill me up later!'
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { init } from './commands/init.js';
|
||||
import help from './commands/help.js';
|
||||
|
||||
const regex = /(?<=--|-)\w+/gm;
|
||||
const flags = process.argv.slice(2).join(' ').match(regex);
|
||||
|
||||
@@ -12,7 +14,11 @@ const args = rawArgs
|
||||
.filter((e) => !/(--|-)\w+/gm.test(e));
|
||||
|
||||
const cmdName = args[0];
|
||||
const commands = new Map([['init', init]]);
|
||||
const commands = new Map([
|
||||
['help', help],
|
||||
['', help],
|
||||
['init', init],
|
||||
]);
|
||||
|
||||
const found = commands.get(cmdName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user