guide command
This commit is contained in:
parent
0452f4dafd
commit
9c15b76a7a
|
@ -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
|
||||||
|
`
|
||||||
|
);
|
||||||
|
}
|
|
@ -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)},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue