add ps command
This commit is contained in:
parent
c6f39c986d
commit
f790041042
|
@ -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)},
|
||||
|
|
|
@ -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
|
||||
`);
|
||||
}
|
Loading…
Reference in New Issue