diff --git a/loader.mjs b/loader.mjs index 2e5a2b9..0bdc909 100644 --- a/loader.mjs +++ b/loader.mjs @@ -36,6 +36,7 @@ export async function resolve(specifier, context, defaultResolver) { '@commands:create': pathResolve(__dirname, 'src', 'commands', 'create.ts'), '@commands:ls': pathResolve(__dirname, 'src', 'commands', 'ls.ts'), '@commands:save': pathResolve(__dirname, 'src', 'commands', 'save.ts'), + '@commands:help': pathResolve(__dirname, 'src', 'commands', 'help.ts'), '@builtin:systemd': pathResolve(__dirname, 'src', 'modules', 'systemd.ts'), '@builtin:sshd': pathResolve(__dirname, 'src', 'modules', 'sshd.ts'), diff --git a/src/commands/help.ts b/src/commands/help.ts new file mode 100644 index 0000000..7beb729 --- /dev/null +++ b/src/commands/help.ts @@ -0,0 +1,23 @@ +export default function() { + console.log(`Vogue Kernel Commands + + save : Save the current state of the system to the disk + + reset : Wipe the state of the system + + create m : Create a new Instance of a given module + m : The FQDN of the module + : An alias for the created instance + : A pre-set Id for the module + + ls : Lists the current instances + + script f : Executes a script + f : The path to the script + + set v ...d : Set a kernel variable + v : The name of the variable + ...d : The value (or values, space delimited) + +`) +} \ No newline at end of file diff --git a/src/externals.d.ts b/src/externals.d.ts index 737a2e5..5eee178 100644 --- a/src/externals.d.ts +++ b/src/externals.d.ts @@ -39,4 +39,5 @@ declare module "@commands:executor"; declare module "@commands:create"; declare module "@commands:ls"; declare module "@commands:save"; +declare module "@commands:help"; declare module "@echo off"; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index b633848..42bf4db 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ import createExecutor from '@commands:executor'; import create from '@commands:create'; import ls from '@commands:ls'; import save from '@commands:save'; +import help from '@commands:help'; import * as uuid from 'uuid'; import serverline from 'serverline'; import { existsSync, readFileSync, writeFileSync } from 'fs'; @@ -88,7 +89,8 @@ export const kernel = { }, set(variable: string, ...rest: string[]) { (system as any)[variable] = rest.join(' '); - } + }, + help: help }; const executor = createExecutor(kernel); @@ -123,10 +125,11 @@ const executor = createExecutor(kernel); exec(a, false); }); serverline.on('SIGINT', () => exec('quit')); + console.log('For help, type help'); })().catch((e: Error) => { console.error(e); }); checkpoint('Kernel Loaded'); -import '@echo off'; \ No newline at end of file +// import '@echo off';