Feature request (ls): format file mode (permission) in base 8
I noticed that shx ls -l prints the file permission in base 10 (decimal). This is difficult to understand since this is represented more naturally in base 8 (octal). The ShellJS API (shell.ls('-l')) actually returns a structured object, however it includes a toString() implementation on the object as well:
https://github.com/shelljs/shelljs/blob/ad911973cdbe1a6f5f3192d215c78ce3a9060492/src/ls.js#L136-L139
Most folks relying on shell.ls('-l') are probably using the structured object rather than its stringified version. The stringified version is mostly relevant for https://github.com/shelljs/shx and https://github.com/nfischer/n_shell.
We could also consider converting this into the -rw-rw-r-- format instead of octal, but that's a bit more work.
Other discrepancies I noticed:
-
shx ls -lprints a UID (as an integer) instead of the username/groupname -
shx ls -loutputs timestamps in the formatWed Jan 05 2022 19:05:48 GMT-0800 (Pacific Standard Time)as opposed to the more succinctJan 5 19:05