dynamic command name

This commit is contained in:
b1ek 2023-03-15 16:23:33 +10:00
parent 2528c0e356
commit a598fa9364
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 2 additions and 1 deletions

View File

@ -8,9 +8,10 @@ const fs = require('../fs');
*/
module.exports = (argv, terminal) => {
if (argv.indexOf('--help') != -1) {
terminal.writeln('Usage: cat [file] [-n]');
terminal.writeln(`Usage: ${argv[0]} [files] [-n]`);
terminal.writeln(' -n --number: show lines numbers');
terminal.writeln(' --help: show this help');
terminal.writeln('Reads file into stdout');
return;
}
const numbers = (argv.indexOf('-n') != -1) || (argv.indexOf('--number') != -1);