Sure, you could say that `ls -t` should be `ls | sort --time`, and if command output was structured rather than just text, and standardized, that would work and be easy to implement in a cross-tool manner. But now we have `sort --time`, which is also an option that you say shouldn't exist. So now what? `ls | timesort` and `ls | sizesort`? That's just silly.
Ok, how about something that doesn't affect how the output is presented, but what output is presented. Most of the time I just want `ls`, but sometimes I want to see dotfiles, so I have `ls -a`. How do we fix that? `ls` and `lshidden`? Again: silly. Do we just say "dotfiles are stupid; we shouldn't have this artificial concept of hidden files"? No, that's silly too.
I get that your follow-up post softens the absolutism with "far too often", but your original post did assert that "every" command line option is a bug, and I'm tired of this "options are bad" argument. Overall I would rather have the option to change behavior than not. Take those options away, and we get complaints that the maintainers are dumbing things down and removing choice.
It's really a no-win situation: either your software is bloated, or it's not flexible enough. Few people agree on where the happy medium is. Discussions about this are, IMO, just tiring and pointless, and are some of the worst forms of bike-shedding. The only reason a potentially-useful option should be removed (or not added in the first place) is if the option creates a maintenance burden that the maintainer is not comfortable taking on.
Every option doubles the amount of testing required to exhaustively test the program. This soon reaches the level of impossibility. My point is to encourage people to take a hard look at the options and consider redesigns and specification changes to eliminate as many as one can.
The same applies to `if` statements in code. Finding ways to change the data structures and program logic to eliminate edge cases and the `if` cases is a significant goal of mine.
It also applies to compiler warnings. In the case of C, the warnings are there because the C Standard allows practices that are known to cause many problems, but the C compiler vendor has to compile them anyway, and so choose to make them warnings. But for a newer language, the warnings come about because the language designer did not design the language rules well enough.
True, but pairwise-independent combinatorial testing provides almost-exhaustive coverage with non-exponential growth in test cases: https://github.com/microsoft/pict
In PowerShell `ls` is only used for retrieving the filesystem objects (files and directories). It does not have options for sorting or formatting[1]
Sorting is generally handled by `sort` (alias for the Sort-Object cmdlet).
Formatting is generally handled by one of the format commands, like format-table (alias `ft`) or format-list (alias `fl`) or by converting into another format like e.g. json or xml through `convertto-json`.
I.e. if I want to display the full path of every file sorted by descending by last access, I would write:
ls | sort -d LastAccessTime | select fullname
[1] except for the `-name` switch which is more of an optimization which only retrieves the local name as string objects.What really is the difference between `sort LastWriteTime` and `sort --LastWriteTime`? An argument without the dashes doesn't seem any fundamentally different from a flag.