Maxim Zhiburt
7cfd4d2cfa
nu-table: Add table option --abbreviated
(#10399)
- Added `--abbreviated`/`-a` option
- Adedd `abbreviate_if_longer_than` config opt for it.
```nu
ls | table -a 3
```
```
╭───┬────────────────────┬──────┬───────────┬──────────────╮
│ # │ name │ type │ size │ modified │
├───┼────────────────────┼──────┼───────────┼──────────────┤
│ 0 │ CODE_OF_CONDUCT.md │ file │ 3.4 KiB │ 4 days ago │
│ 1 │ CONTRIBUTING.md │ file │ 18.3 KiB │ 2 weeks ago │
│ 2 │ Cargo.lock │ file │ 144.3 KiB │ 15 hours ago │
│ 3 │ ... │ ... │ ... │ ... │
│ 4 │ tests │ dir │ 4.0 KiB │ 4 months ago │
│ 5 │ toolkit.nu │ file │ 14.6 KiB │ 5 days ago │
│ 6 │ wix │ dir │ 4.0 KiB │ 2 months ago │
╰───┴────────────────────┴──────┴───────────┴──────────────╯
```
```nu
$env | table -a 3
```
```
╭──────────────────┬──────────────────────────────────────────────────────────────────────────╮
│ BROWSER │ firefox │
│ CARGO │ /home/maxim/.rustup/toolchains/1.70.0-x86_64-unknown-linux-gnu/bin/cargo │
│ CARGO_HOME │ /home/maxim/.cargo │
│ ... │ ... │
│ XDG_SESSION_TYPE │ x11 │
│ XDG_VTNR │ 7 │
│ _ │ /home/maxim/.cargo/bin/cargo │
╰──────────────────┴──────────────────────────────────────────────────────────────────────────╯
```
close #10393
PS: Maybe as a separate issue (good candidate for `GOOD FIRST ISSUE`)
add a config option to change a default `...` truncation sign to a
custom? (which would be applicable not only for `--abbreviated` but all
kind of tables)
---------
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-09-20 12:59:08 -05:00
..
2023-07-17 18:43:51 +02:00
2023-08-24 07:08:58 -05:00
2023-08-04 06:06:00 +12:00
2023-07-17 18:43:51 +02:00
2023-09-13 23:53:55 +02:00
2023-07-12 18:12:59 +02:00
2023-09-13 16:54:03 +02:00
2023-08-29 13:18:52 -07:00
2023-09-01 00:08:27 +02:00
2022-11-22 16:58:11 -08:00
2023-09-12 13:03:05 +02:00
2023-08-24 07:08:58 -05:00
2023-09-13 23:53:55 +02:00
2023-07-17 18:43:51 +02:00
2023-07-17 18:43:51 +02:00
2023-06-21 09:33:01 +12:00
2023-05-17 18:55:26 -05:00
2023-05-17 18:55:26 -05:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-07-12 18:12:59 +02:00
2023-09-21 03:58:29 +12:00
2023-09-06 16:39:35 +08:00
2023-07-21 08:25:06 -05:00
2023-07-21 17:32:37 +02:00
2023-07-14 15:20:35 +12:00
2023-07-06 08:31:31 -07:00
2023-09-13 06:35:01 +12:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2022-12-22 00:33:26 +02:00
2023-05-17 18:55:26 -05:00
2023-05-17 18:55:26 -05:00
2023-06-10 16:57:26 -05:00
2023-08-23 16:03:26 -05:00
2023-07-21 17:32:37 +02:00
2023-09-13 06:35:01 +12:00
2023-08-02 10:57:58 -05:00
2023-07-21 17:32:37 +02:00
2023-08-31 23:10:29 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-08-31 23:10:29 +02:00
2023-07-21 17:32:37 +02:00
2023-09-20 12:57:29 -05:00
2023-05-22 13:54:04 -05:00
2023-07-23 20:14:51 +02:00
2023-09-13 23:53:55 +02:00
2023-09-15 15:46:25 -05:00
2023-05-17 18:55:26 -05:00
2023-08-23 16:03:26 -05:00
2023-08-25 08:48:05 +12:00
2023-09-14 10:18:29 +12:00
2023-08-09 14:12:58 +02:00
2023-09-13 06:35:01 +12:00
2023-09-03 19:25:00 -05:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-09-08 13:57:38 -05:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-09-16 21:49:10 +02:00
2023-03-15 18:54:55 +13:00
2023-07-17 18:43:51 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-09-09 15:01:25 -05:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-07-17 18:43:51 +02:00
2023-09-12 14:06:56 +08:00
2023-07-21 17:32:37 +02:00
2023-07-17 18:43:51 +02:00
2023-07-21 17:32:37 +02:00
2023-08-18 20:45:10 +03:00
2023-09-13 13:49:55 +02:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-08-31 23:10:29 +02:00
2023-07-21 17:32:37 +02:00
2023-09-01 00:08:27 +02:00
2023-09-01 00:08:27 +02:00
2023-09-20 12:59:08 -05:00
2022-12-22 16:38:07 -08:00
2023-07-21 17:32:37 +02:00
2023-04-28 13:25:44 +02:00
2023-07-17 18:43:51 +02:00
2023-09-10 17:54:33 -05:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00
2023-08-31 23:11:04 +02:00
2023-08-31 23:11:04 +02:00
2023-07-21 17:32:37 +02:00
2023-08-29 13:18:52 -07:00
2023-07-20 19:10:53 -05:00
2023-09-13 06:35:01 +12:00
2023-07-17 18:43:51 +02:00
2023-07-21 17:32:37 +02:00
2023-07-21 17:32:37 +02:00