help command

stable
Valerie 2021-12-22 04:54:25 -05:00
parent a539626667
commit 9b72668cb1
4 changed files with 30 additions and 2 deletions

View File

@ -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'),

View File

@ -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 <n> <i> : Create a new Instance of a given module
m : The FQDN of the module
<n> : An alias for the created instance
<i> : 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)
`)
}

1
src/externals.d.ts vendored
View File

@ -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";

View File

@ -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';
// import '@echo off';