help command
parent
a539626667
commit
9b72668cb1
|
|
@ -36,6 +36,7 @@ export async function resolve(specifier, context, defaultResolver) {
|
||||||
'@commands:create': pathResolve(__dirname, 'src', 'commands', 'create.ts'),
|
'@commands:create': pathResolve(__dirname, 'src', 'commands', 'create.ts'),
|
||||||
'@commands:ls': pathResolve(__dirname, 'src', 'commands', 'ls.ts'),
|
'@commands:ls': pathResolve(__dirname, 'src', 'commands', 'ls.ts'),
|
||||||
'@commands:save': pathResolve(__dirname, 'src', 'commands', 'save.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:systemd': pathResolve(__dirname, 'src', 'modules', 'systemd.ts'),
|
||||||
'@builtin:sshd': pathResolve(__dirname, 'src', 'modules', 'sshd.ts'),
|
'@builtin:sshd': pathResolve(__dirname, 'src', 'modules', 'sshd.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 <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)
|
||||||
|
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
@ -39,4 +39,5 @@ declare module "@commands:executor";
|
||||||
declare module "@commands:create";
|
declare module "@commands:create";
|
||||||
declare module "@commands:ls";
|
declare module "@commands:ls";
|
||||||
declare module "@commands:save";
|
declare module "@commands:save";
|
||||||
|
declare module "@commands:help";
|
||||||
declare module "@echo off";
|
declare module "@echo off";
|
||||||
|
|
@ -6,6 +6,7 @@ import createExecutor from '@commands:executor';
|
||||||
import create from '@commands:create';
|
import create from '@commands:create';
|
||||||
import ls from '@commands:ls';
|
import ls from '@commands:ls';
|
||||||
import save from '@commands:save';
|
import save from '@commands:save';
|
||||||
|
import help from '@commands:help';
|
||||||
import * as uuid from 'uuid';
|
import * as uuid from 'uuid';
|
||||||
import serverline from 'serverline';
|
import serverline from 'serverline';
|
||||||
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
||||||
|
|
@ -88,7 +89,8 @@ export const kernel = {
|
||||||
},
|
},
|
||||||
set(variable: string, ...rest: string[]) {
|
set(variable: string, ...rest: string[]) {
|
||||||
(system as any)[variable] = rest.join(' ');
|
(system as any)[variable] = rest.join(' ');
|
||||||
}
|
},
|
||||||
|
help: help
|
||||||
};
|
};
|
||||||
|
|
||||||
const executor = createExecutor(kernel);
|
const executor = createExecutor(kernel);
|
||||||
|
|
@ -123,10 +125,11 @@ const executor = createExecutor(kernel);
|
||||||
exec(a, false);
|
exec(a, false);
|
||||||
});
|
});
|
||||||
serverline.on('SIGINT', () => exec('quit'));
|
serverline.on('SIGINT', () => exec('quit'));
|
||||||
|
console.log('For help, type help');
|
||||||
|
|
||||||
})().catch((e: Error) => {
|
})().catch((e: Error) => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
checkpoint('Kernel Loaded');
|
checkpoint('Kernel Loaded');
|
||||||
import '@echo off';
|
// import '@echo off';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue