From 86eba769dc80cd7dcd091fb942340cc69a779fa5 Mon Sep 17 00:00:00 2001 From: Innovation Inc Date: Thu, 14 May 2020 19:05:05 -0500 Subject: [PATCH] Updated Terminal: Adding Commands (markdown) --- Terminal:-Adding-Commands.md | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Terminal:-Adding-Commands.md b/Terminal:-Adding-Commands.md index 0870b53..67be72e 100644 --- a/Terminal:-Adding-Commands.md +++ b/Terminal:-Adding-Commands.md @@ -1,17 +1,27 @@ # Terminal: Adding Commands - + +## Adding Commands Permanently The terminal, which runs on JavaScript, can have commands added to it. -## Step 1 +### Step 1 +Open the terminal file. It is located at `terminal/terminal.js` ![](https://lh3.googleusercontent.com/hqlqMsGf2UuaRQeIidJRsM-ZCDETK_3cSkldMxATYkQHmUE86gL8GEbCGDjWdjsrryWeC06uTdXL5LZ2gSaqUxYOIJnb0yVOo43ygFowEFs1AnXGXjqqaYkdudcuj9VhTjKYjcKuhw=w2400) -Add the name of your command to the list (around line 25). -## Step 2 -![](https://lh3.googleusercontent.com/t3ABR85g_j_bwyEsqvqjTH4UaBoH55NqvDALNDyma_7-1IPPfImN6JANKv7oGSS0BT1gyb9yTrbOzknTD8eoCCm3r-oyJTV6ruroD5t0gcxImZEHWIr2z0lGCvM3e1GvV4tQsQpaVg=w2400) -Add your code using the basic framework above (around line 152). It should look like this: -`case 'mycommand': +Add the name of your command to the list. + +### Step 2 + +Add your code using the basic framework below. It should look like this: +` +case 'mycommand': //Your code goes here - brake;` + break; +` +Make your modifications and save the file. -## Step 3 -Load up the terminal and run the command by typing its name. You should also be able to see it when running "help" \ No newline at end of file +### Step 3 +Open the terminal and run the command by typing its name. You should also be able to see it when running "help". + +## Adding Commands Temporarily With Modules + +Modules are a way of temporarily adding functions to DremJS. Documentation on it can be found [here](https://github.com/sparrdrem/DremJS/wiki/Modules). \ No newline at end of file