New Code (reinventing the wheel edition)
I'm not exactly sure how I got the idea into my head, but last weekend I found myself looking at the copy of ls on pell, thinking “there are too many silly options for this program”, looking at the copy of ls on the work machines and thinking, for the approximately 500th time, “the idiot who thought that color-ls was a good idea needs to be hunted down and beaten to death with an accessability handbook”, then looking at the copy of ls on one of the local bsd machines and thinking that that one was too rococo to live with. And soon after I did this I found myself starting to code.
The versions of ls that most Linux boxes are infested with have all the options you can eat, and a usage message that can choke a horse
Usage: o.ls [OPTION]... [PATH]...
-A --almost-all do not list implied . and .. -a --all do not hide entries starting with . -B --ignore-backups do not list implied entries ending with ~ -b --escape print octal escapes for nongraphic characters -C list entries by columns -c sort by change time; with -l: show ctime -D --dired generate output well suited to Emacs' dired mode -d --directory list directory entries instead of contents -e --full-time list both date and full time -F --classify append a character for typing each entry -f do not sort, enable -aU, disable -lsto --format=WORD across -x, commas -m, horizontal -x, long -l, single-column -1, verbose -l, vertical -C -G --no-group inhibit display of group information -g (ignored) -I --ignore=PATTERN do not list implied entries matching shell PATTERN -i --inode print index number of each file -k --kilobytes use 1024 blocks, not 512 despite POSIXLY_CORRECT -L --dereference list entries pointed to by symbolic links -l use a long listing format -m fill width with a comma separated list of entries -N --literal do not quote entry names -n --numeric-uid-gid list numeric UIDs and GIDs instead of names -o --color, --colour colorize entries according to type --colo(u)r=WORD yes -o, no, tty (if output is a terminal) -p append a character for typing each entry -Q --quote-name enclose entry names in double quotes -q --hide-control-chars print ? instead of non graphic characters -R --recursive list subdirectories recursively -r --reverse reverse order while sorting -S sort by file size -s --size print block size of each file --sort=WORD ctime -c, extension -X, none -U, size -S, status -c, time -t --time=WORD atime -u, access -u, use -u -T --tabsize=COLS assume tab stops at each COLS instead of 8 -t sort by modification time; with -l: show mtime -U do not sort; list entries in directory order -u sort by last access time; with -l: show atime -w --width=COLS assume screen width instead of current value -x list entries by lines instead of by columns -X sort alphabetically by entry extension -1 list one file per line --help display this help and exit --version output version information and exit
While the traditional Unix ls had a smaller handful of options and a single-line usage message. Oh, and no --color-ls option
Guess which one I prefer? And at 766 lines, it's a small enough bit of code to write and do some trivial tests on in about a week.
It's still tossed into the Mastodon-next source scrapbox, of course (with bits of /bin and libc just sort of flung in there willy-nilly), but having a bit pile of random new code will be a subtle encouragement for working on the packaging system. And in the meantime, I've got a new ls that I can hurl, with great force, at the modern Linux systems I develop on at work and get rid of at least one of the offensive syntax-coloring "enhancements" that makes a modern Unix a less-inviting programming environment.