guide command

This commit is contained in:
b1ek 2023-03-23 09:43:20 +10:00
parent 0452f4dafd
commit 9c15b76a7a
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,35 @@
module.exports = (argv, terminal) => {
if (argv.indexOf('--help') != -1) {
terminal.write(
`Usage: ${argv[0]} [-r]
Print out the guide how to use the terminal
-r \t Undocumented feature
`
);
return;
}
if (argv.indexOf('-r') != -1) {
// TODO: put some easter eggs here
}
terminal.write(
`Welcome to my resume!
This is a UNIX terminal emulator.
Most of the basic unix commands are available (ls, cat, rm, mkdir, etc)
Although you may not be a unix user so heres a quick summary what command does what:
ls \t- List files in directory
cat \t- Read file contents to terminal
rm \t- Remove file contents
mkdir \t- Create directory
wget \t- Download file from internet (more: wget --help)
ps \t- List processes
l \t- alias to ls -al
Also there are some custom defined commands which are somewhat more fun:
guide \t- Show you this menu
skills \t- My skills info
`
);
}

View File

@ -4,7 +4,6 @@ let cmds = {
'cmdls': require('./cmds'), 'cmdls': require('./cmds'),
'help': require('./cmds'), 'help': require('./cmds'),
'ls': require('./ls'), 'ls': require('./ls'),
'skills': require('./skills'),
'mkdir': require('./mkdir'), 'mkdir': require('./mkdir'),
'wget': require('./wget'), 'wget': require('./wget'),
'export_file': require('./export_file'), 'export_file': require('./export_file'),
@ -14,6 +13,10 @@ let cmds = {
'clear': require('./clear'), 'clear': require('./clear'),
'rm': require('./rm'), 'rm': require('./rm'),
'guide': require('./guide'),
'skills': require('./skills'),
// alias l='ls -l' // alias l='ls -l'
'l': (a,t) => {require('./ls')([...a, '-l'], t)}, 'l': (a,t) => {require('./ls')([...a, '-l'], t)},
}; };