Nushell: Should we keep the `reverse` command as well as `--reverse` flags on some commands

Created on 26 Aug 2019  路  4Comments  路  Source: nushell/nushell

Should we keep sort-by foo --reverse when we also have sort-by foo | reverse.

I don't have a strong opinion on this but it might flow on to other similar things where we could either add a flag to multiple commands or rely on more composable commands.

good first issue

Most helpful comment

Less flags more pipes seems to be a space this project is well-equipped to explore.

All 4 comments

Looking at the principle and goals of the project, I assume it might make sense to use the piped solution. On the one hand it seems more conforming, on the other it seems more modular, as you could obviously rearrange the reverse in another flow whereas an option is bound to a specific command.
There is also the option to make both available, but I don't think this would be useful. It is helpful to make certain things strict, especially looking from a mechanical point of view, to partially enforce good practice and following a pattern that has as few exceptions to the rule as possible, so that understanding the concept is easy and its usage becomes intuitive over time, as you understand the prime design model behind this project.

Less flags more pipes seems to be a space this project is well-equipped to explore.

Yeah, let's do this!

We'll eventually want to optimize things like this (#437), but "less flags, more pipes" is a pretty good guiding principle.

Please send pull request!

Will do!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonathandturner picture jonathandturner  路  5Comments

ChrisDenton picture ChrisDenton  路  4Comments

KasMA1990 picture KasMA1990  路  4Comments

Matalus picture Matalus  路  4Comments

alper picture alper  路  4Comments