Compare commits
No commits in common. "3e3553fd818bea3e591c5cc4980e01aab3da5de6" and "d20c29d04243897550a27f56334dedadb9627b8d" have entirely different histories.
3e3553fd81
...
d20c29d042
|
@ -23,6 +23,10 @@ module.exports = (argv, terminal) => {
|
|||
const long_format = has_arg('-l');
|
||||
|
||||
directories.shift();
|
||||
|
||||
// remove .* files if -a not specified
|
||||
if (!all)
|
||||
directories = directories.filter(x => !x.startsWith('.'));
|
||||
|
||||
// remove arguments
|
||||
directories = directories.filter(x => !x.startsWith('-'));
|
||||
|
@ -48,14 +52,11 @@ module.exports = (argv, terminal) => {
|
|||
terminal.writeln(`${argv[0]}: cannot access '${dir}': No such file or directory`);
|
||||
return;
|
||||
}
|
||||
let files = ['.', '..', ...fs.readdirSync(dir)];
|
||||
if (!all)
|
||||
files = files.filter(x => !x.startsWith('.'));
|
||||
|
||||
let files = fs.readdirSync(dir);
|
||||
files.forEach((file, i) => {
|
||||
|
||||
if (!long_format)
|
||||
terminal.write(file + '\033[0m\t');
|
||||
terminal.write(file + '\033[0m ');
|
||||
else
|
||||
terminal.writeln('drwx-xr-x 1 nobody nobody 4.0K Jan 1 13 01:00 ' + file);
|
||||
if ((i+1) % 5 == 0)
|
||||
|
|
Loading…
Reference in New Issue