mirror of
https://github.com/nushell/nushell.git
synced 2025-08-13 23:58:25 +02:00
nu-table/ Add -t/theme
argument && Replace -n/start-number
with -i/index
(#11058)
ref #11054 cc: @fdncred I've not figured out how to be able to have a flag option as `table -i` :( ```nu ~/bin/nushell> [[a b, c]; [1 [2 3 3] 3] [4 5 [1 2 [1 2 3]]]] | table -e --width=80 --theme basic -i false +---+-------+-----------+ | a | b | c | +---+-------+-----------+ | 1 | +---+ | 3 | | | | 2 | | | | | +---+ | | | | | 3 | | | | | +---+ | | | | | 3 | | | | | +---+ | | +---+-------+-----------+ | 4 | 5 | +-------+ | | | | | 1 | | | | | +-------+ | | | | | 2 | | | | | +-------+ | | | | | +---+ | | | | | | | 1 | | | | | | | +---+ | | | | | | | 2 | | | | | | | +---+ | | | | | | | 3 | | | | | | | +---+ | | | | | +-------+ | +---+-------+-----------+ ``` ```nu ~/bin/nushell> [[a b, c]; [1 [2 3 3] 3] [4 5 [1 2 [1 2 3]]]] | table -e --width=80 --theme basic -i 100 +-----+---+-------------+-----------------------+ | # | a | b | c | +-----+---+-------------+-----------------------+ | 100 | 1 | +-----+---+ | 3 | | | | | 100 | 2 | | | | | | +-----+---+ | | | | | | 101 | 3 | | | | | | +-----+---+ | | | | | | 102 | 3 | | | | | | +-----+---+ | | +-----+---+-------------+-----------------------+ | 101 | 4 | 5 | +-----+-------------+ | | | | | | 100 | 1 | | | | | | +-----+-------------+ | | | | | | 101 | 2 | | | | | | +-----+-------------+ | | | | | | 102 | +-----+---+ | | | | | | | | | 100 | 1 | | | | | | | | | +-----+---+ | | | | | | | | | 101 | 2 | | | | | | | | | +-----+---+ | | | | | | | | | 102 | 3 | | | | | | | | | +-----+---+ | | | | | | +-----+-------------+ | +-----+---+-------------+-----------------------+ ```
This commit is contained in:
@ -38,9 +38,11 @@ fn try_build_map(
|
||||
style_computer,
|
||||
ctrlc,
|
||||
Span::unknown(),
|
||||
0,
|
||||
usize::MAX,
|
||||
(config.table_indent.left, config.table_indent.right),
|
||||
config.table_mode,
|
||||
0,
|
||||
false,
|
||||
);
|
||||
let result = ExpandedTable::new(None, false, String::new()).build_map(&record, opts);
|
||||
match result {
|
||||
@ -63,10 +65,13 @@ fn try_build_list(
|
||||
style_computer,
|
||||
ctrlc,
|
||||
Span::unknown(),
|
||||
0,
|
||||
usize::MAX,
|
||||
(config.table_indent.left, config.table_indent.right),
|
||||
config.table_mode,
|
||||
0,
|
||||
false,
|
||||
);
|
||||
|
||||
let result = ExpandedTable::new(None, false, String::new()).build_list(&vals, opts);
|
||||
match result {
|
||||
Ok(Some(out)) => out,
|
||||
|
Reference in New Issue
Block a user