add ps command

This commit is contained in:
b1ek 2023-03-20 08:52:45 +10:00
parent c6f39c986d
commit f790041042
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 21 additions and 0 deletions

View File

@ -10,6 +10,7 @@ let cmds = {
'export_file': require('./export_file'),
'import_file': require('./import_file'),
'zsh': require('./zsh'),
'ps': require('./ps'),
// alias l='ls -l'
'l': (a,t) => {require('./ls')([...a, '-l'], t)},

View File

@ -0,0 +1,20 @@
const { Terminal } = require("xterm");
/**
*
* @param {string[]} argv
* @param {Terminal} terminal
*/
module.exports = (argv, terminal) => {
if (argv.indexOf('--help') != -1) {
terminal.write(
`Usage: ${argv[0]} [OPTIONS]
Show current process list`);
return;
}
terminal.write(
`\tPID\tTTY\tTIME\tCMD
42\tpts/0\t00:00:00\tzsh
43\tpts/0\t00:00:00\tps
`);
}