Conversation
|
Cool! This looks interesting. What's going on here? {week: 10, day: 2, sign: '+'} | into duration --unit sec
Error: nu::shell::incompatible_parameters
× Incompatible parameters.
╭─[entry #2:1:33]
1 │ {week: 10, day: 2, sign: '+'} | into duration --unit sec
· ──────┬────── ─────┬────
· │ ╰── the units should be included in the record
· ╰── got a record as inputI can do this, but maybe I shouldn't be able to? ❯ 10wk + 2day | into duration --unit sec
10wk 2day |
|
Ah, yeah interesting, that shows inconsistent behavior. I implemented But with the second command from you previous comment, I think it also doesn't make sense to be able to pass a unit when you already have a duration as input, but here it look slike the --unit flag is just purely ignored. I like consistency, but I have the intuition that the "ignoring" behavior is currently more common across the differnt commands, so if we wanted to change that, this could take some time. On the other hand, I feel like getting an error in those cases really does make sense... Well, maybe we could also say that having this slight inconsistent behavior is not our highest priority to fix 😅 |
|
I agree that it's for |
|
Done 🟢 |
dc80ffb to
cc17390
Compare
|
Thanks |
|
I'll update my PR on the release notes' branch to mention this as well |
Closes #15543
Description
datetime.rsbased on a suggestion in my last PR on "datetime from record"into durationwork with durations inside a record, provided as a cell pathinto durationwork with durations as recordUser-Facing Changes
Tests + Formatting
into durationinto durationAfter Submitting
If this is merged in time, I'll update my PR on the "datetime handling highlights" for the release notes.