nushell: Support ignoring program errors when working with `;`
Related problem
No response
Describe the solution you’d like
Bash has:
&&which means “continue only if everything before me succeeded”||which means “run the stuff to the right only if stuff to the left failed”;which means “run the stuff to the right no matter what”
Nu has:
;which means “continue only if everything before me succeeded”do -i { ... };which means “run the stuff to the right only if no shell errors occurred”
Proposal: add do -p { ... }; which means “run the stuff to the right only if no program errors occurred”. Combined with -i, you get “run the stuff to the right no matter what.”
Describe alternatives you’ve considered
No response
Additional context and details
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (10 by maintainers)
@dandavison hey, I like that! @WindSoilder you get the old behavior and people like me can still activate only the error catching we need. Everybody on board?
@SUPERCILEX how about adding your low-level control as two new flags (names up to you), so we would have
-imeaning “ignore all”and the implementation of
-iwould be activating both your flags?Maybe this isn’t too unpalatable because, after all, “ignore” didn’t specify what it was ignoring whereas your additions will be explicit about this.
I suspect the actual user interface here will evolve – as you’ve touched upon on the discussion – so I think it’s OK to have these low-level flags even if the original
-inow becomes unnecessary in the presence of the two new flags.