diff --git a/src/commands/help.js b/src/commands/help.js new file mode 100644 index 0000000..b808402 --- /dev/null +++ b/src/commands/help.js @@ -0,0 +1,3 @@ +export function help() { + console.log('This is sern cli help section\n\n' + 'Fill me up later!'); +} diff --git a/src/index.js b/src/index.js index c9d465f..b7409d2 100644 --- a/src/index.js +++ b/src/index.js @@ -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 rawArgs = process.argv.slice(2); const flags = rawArgs.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);