New peek command for inspecting streams without collecting#17796
New peek command for inspecting streams without collecting#17796Bahex wants to merge 3 commits intonushell:mainfrom
peek command for inspecting streams without collecting#17796Conversation
|
Making Maybe |
| } | ||
|
|
||
| fn add_peek_metadata( | ||
| mut metadata: Option<PipelineMetadata>, |
There was a problem hiding this comment.
is there any reason we are not using Option<&mut PipelineMetadata> ?
|
If Alternatively, can we envision a use-case (I can't at the moment) where it would be useful to have: peek 2 {|p|
some conditional based on peeked value {
metadata access {
..
}
}
}Granted, that adds two levels of nesting, and again, I'm not even sure there's a use-case. |
|
@NotTheDr01ds I think having a separate command is better because:
|
|
|
c9372fa to
cfef425
Compare
cfef425 to
b23c53b
Compare
peekcommand allows checking whether the pipeline input is a value or a stream, and accessing the first$nelements of a stream without collecting the stream.I chose to provide the information as part of pipeline metadata rather than providing it as a closure parameter (like
metadata access). While this meanspeekis only useful in combinationmetadata access, it avoids having to use nested closures when they are used together:Release notes summary - What our users need to know
TODO
Tasks after submitting
N/A