mortdeus/goblin — pull request #2 by kutani (2013-01-30 01:37:37+00:00)
Title: ls

An implementation of ls. Most flags as listed in the man page for Plan 9's ls(1) are implemented, with the following exceptions:

-q - Lists qid info, which is pretty specialized for P9; p9p fakes it somewhat
-Q - Disables quoting of dirent names with non-rc-friendly characters. Filename quoting is not implemented yet, so this is meaningless. TODO

Additional notes:
-m (show last user to access) is also not a portable construct, and p9p completely fakes it by just printing '[]'. I've imitated this behavior.

-l long listing in P9's ls(1) includes two additional fields for FS type and subdevice number, neither of which seem to have any bearing on non-P9 systems, at least as implemented by p9p's ls. I think a discussion is warranted on what exactly should be done here, if anything. For now it just lists the number of hard links, ala other versions of ls.