Skip to content

Commit

Permalink
Added clear command
Browse files Browse the repository at this point in the history
  • Loading branch information
Electogenius committed Dec 11, 2021
1 parent 0621037 commit ce9b305
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ hmm.pathToPath=(p,cwd)=>{
hmm.storage.cmd = {
help(c) {
`Built-in commands:
cd: change current directory
echo: displays text
err: displays an error
ls: lists folders and files in the current directory
open: opens an file or path
ptbye: opens a terminal window
wait: wait a certain amount of milliseconds
cd: change current directory
ls: lists folders and files in the current directory`.split('\n').forEach(c.echo)
`.split('\n').slice(0,-1).forEach(c.echo)
},
echo() {
(function () {
Expand Down Expand Up @@ -77,7 +78,8 @@ ls: lists folders and files in the current directory`.split('\n').forEach(c.echo
var f=hmm.pathToJs(hmm.pathToPath(e.join``,c.eval('cwd')))
Object.keys(f).sort().forEach(c.echo)
,new Promise(r => r())
}
},
clear(){c.eval('lines=[];ty=-1'),0[0]}
}
for (const cmd in hmm.storage.cmd) {
hmm.storage.cmd[cmd] = String(hmm.storage.cmd[cmd])
Expand Down

0 comments on commit ce9b305

Please sign in to comment.