-
Notifications
You must be signed in to change notification settings - Fork 0
1.1 Docs: Commands
Louis Stanko edited this page Nov 20, 2020
·
1 revision
Here you can read how to add new custom commands to your terminal, how to customize and what else you can do.
If you want to change the initial behavior you can modify the CMDs
class in core.ts
.
Commands.add(
'commandName', //! case-sensitive
(path: Path, args: string[]): string => {
// path - active directory
// args[0] - command
// args[1..] - first, second, ... argument and so on
return 'this is an <b>html</b> string which will be written to the stdout.';
},
'a short description of your command' // (optional) description of your command
)
Returns all commands
Commands.all() // returns {object} all commands as an object
// pass by reference so direct modification is possible
Returns an array of all registered commands
Commands.keys() // returns {string[]} all command names
Returns the description and function of the command
Commands.find(name: string) // returns {object|undefined}
// pass by reference so direct modification is possible
// param {string} name - the name of the command
- Go to
init.ts
- Edit the first argument of
new CMDs({ ... })
. Delete the object wich has the command you don't want anymore.