mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Make stream info visible to users in describe
(#7589)
Closes #7581. After this PR, `describe` shows `(stream)` next to input that arrived at `describe` as a `ListStream`: ```bash 〉ls | describe table<name: string, type: string, size: filesize, modified: date> (stream) 〉[1 2 3] | each {|i| $i} | describe list<int> (stream) ``` `describe` must collect all items of the stream to display type information for lists and tables. If users need to avoid collecting input, they can use the `-n`/`--no-collect` flag: ```bash 〉[1 2 3] | each {|i| $i} | describe --no-collect stream ```
This commit is contained in:
@ -13,7 +13,7 @@ mod test_examples {
|
||||
MathRound, Path, Random, Split, SplitColumn, SplitRow, Str, StrJoin, StrLength, StrReplace,
|
||||
Url, Values, Wrap,
|
||||
};
|
||||
use crate::{Break, Mut, To};
|
||||
use crate::{Break, Each, Mut, To};
|
||||
use itertools::Itertools;
|
||||
use nu_protocol::{
|
||||
ast::Block,
|
||||
@ -61,6 +61,7 @@ mod test_examples {
|
||||
// Base functions that are needed for testing
|
||||
// Try to keep this working set small to keep tests running as fast as possible
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
working_set.add_decl(Box::new(Each));
|
||||
working_set.add_decl(Box::new(Let));
|
||||
working_set.add_decl(Box::new(Str));
|
||||
working_set.add_decl(Box::new(StrJoin));
|
||||
|
Reference in New Issue
Block a user