3 ms·
This always becomes a tricky debate. Take the `ls` program. MVP would just by `ls`. Or maybe `ls -la` to get all the details. You could theoretically pipe that
by mankyd 7y ago
This always becomes a tricky debate. Take the `ls` program. MVP would just by `ls`. Or maybe `ls -la` to get all the details. You could theoretically pipe that into other programs to get more information.
But I'll be damned if I don't use `ls -lah` because I am a human, not a robot. `ls -1` is also super handy. I am sure there are lots of others that folks use.
So where do you draw the line? It makes way more sense to include a few extra options in your tool rather than requiring your users to jump through extra hoops to get something _they_ find useful.
edit: On the other hand, you don't need to include the kitchen sink, either. I have seen programs with literally hundreds of long-form command line arguments. It's a nightmare to wade through.
- avmich 7y ago> But I'll be damned if I don't use `ls -lah` because I am a human, not a robot. I'd prefer that '-lah' be an external composable modifier. 'ls -la' looks like it is, I think, because it tries to create simpler common case, for the expense of that case be more specialized. Since, as somebody decided, 'ls' by default contain only some information available, one presumably needs 'ls -zz' (a made up option) which would produce all information available, and a composed to it filter which would select what is needed at the time. If composability would be really cheap, we wouldn't need that special '-zz' option. We can even consider an option as a composition of additional operation over generic 'ls' behavior - in this case we wouldn't need the shell 'pipe' operator, and syntax of shell statements would become closer to Haskell's. For example, 'cat' could do something generic by itself, while 'cat note.txt' would be considered a composition of 'cat' and 'note.txt' which creates a specialized behavior (which sort of reminds Forth).
- sgt 7y agoI'm aware of "h" but never really had an issue determining that e.g. 1144623161 means 1.1G. I guess I recognize the actual length of the group of digits and then my brain splits it up backwards into 161 623 144 followed by a a 1.
- lou1306 7y agoThe flags you talk about are mostly about the presentation of the output. The, shall we say, "business logic" of `ls` is still pretty bare-bones. That could be one way to draw a line. Also, I think these presentation/formatting flags are a consequence of the Unix shell "everything-is-text" paradigm. In Powershell, where you pass around structured data rather than text, typically you handle presentation just by piping into the appropriate cmdlet.