mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
2492165fcb
Should close #8035. > **Note** > this is my first technical PR for `nushell` > - i might very well miss things > - i tried to be as complete as possible about the changes > - please require further changes if i did something wrong, i'm open to any remark 😌 # Description this PR adds, when it is defined in the `examples` method of the `Command` implementations, the output of the examples to the output of the `help` command. this PR - only modifies `crates/nu-engine/src/documentation.rs` and the `get_documentation` function - defines a new `WD` constant to print a **W**hite **D**immed `...` - a `match` statement at the end of the example loop to - print a white dimmed `...` when the example is not set, i.e. set to `None` in the `examples` method of the `Command` implementation of a command - pretty print the output of the associated example `Value` when it has been defined > **Warning** > LIMITATIONS: > - i use snippets from `crates/nu-protocol/src/pipeline_data.rs` > - the table creation from `pub PipelineData::print`, i.e. the `let decl_id = ...;` and `let table = ...;` in the change > - the table item printing from `PipelineData::write_all_and_flush`, i.e. the `for item in table { ... }` > > ADDRESSED: > - ~~the formatting of the output is not perfect and has to be fully left aligned with the first column for now~~ (fixed with [`5abeefd558c34ba9bae15e2f183ff4625442921e`..`a62be1b5a2c730959da5dbc028bb91ffe5093f63`](5abeefd558c34ba9bae15e2f183ff4625442921e..a62be1b5a2c730959da5dbc028bb91ffe5093f63)) > - ~~i'm using `.unwrap()` on both the changes above, not sure how to handle this for now~~ (fixed for now thanks to |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE |