diff options
author | Karel Zak | 2019-07-23 16:04:51 +0200 |
---|---|---|
committer | Karel Zak | 2019-07-23 16:24:42 +0200 |
commit | 94dbb322737524027a55e6ed5646dc69c5ed9e5b (patch) | |
tree | d4b325c8890240f984805abce6ace03fc16a2043 /libsmartcols/docs/libsmartcols-sections.txt | |
parent | libfdisk: improve partition copy on resize (diff) | |
download | kernel-qcow2-util-linux-94dbb322737524027a55e6ed5646dc69c5ed9e5b.tar.gz kernel-qcow2-util-linux-94dbb322737524027a55e6ed5646dc69c5ed9e5b.tar.xz kernel-qcow2-util-linux-94dbb322737524027a55e6ed5646dc69c5ed9e5b.zip |
libsmartcols: cleanup and extend padding functionality
LIBSMARTCOLS_DEBUG_PADDING=on in the next examples forces libsmartcols
print '.' as a padding char. See line "ffff" in the exmaples.
* default output is to fill all except last cell
$ LIBSMARTCOLS_DEBUG_PADDING=on ./sample-scols-fromfile --nlines 10 --width 80 --column tests/ts/libsmartcols/files/col-name --column tests/ts/libsmartcols/files/col-number --column tests/ts/libsmartcols/files/col-string --column tests/ts/libsmartcols/files/col-string tests/ts/libsmartcols/files/data-string tests/ts/libsmartcols/files/data-number tests/ts/libsmartcols/files/data-string-empty tests/ts/libsmartcols/files/data-string-empty 2> /dev/null
NAME.. ......NUM STRINGS STRINGS
aaaa.. ........0 aaaa... aaaa
bbb... ......100 bbb.... bbb
ccccc. .......21 ccccc.. ccccc
dddddd ........3 dddddd. dddddd
ee.... ......411 ee..... ee
ffff.. .....5111 .......
gggggg 678993321 gggggg. gggggg
hhh... ..7666666 hhh.... hhh
* scols_table_enable_minout() minimizes output for tailing empty cells, example:
$ LIBSMARTCOLS_DEBUG_PADDING=on ./sample-scols-fromfile --nlines 10 --minout --width 80 --column tests/ts/libsmartcols/files/col-name --column tests/ts/libsmartcols/files/col-number --column tests/ts/libsmartcols/files/col-string --column tests/ts/libsmartcols/files/col-string tests/ts/libsmartcols/files/data-string tests/ts/libsmartcols/files/data-number tests/ts/libsmartcols/files/data-string-empty tests/ts/libsmartcols/files/data-string-empty 2> /dev/null
NAME.. ......NUM STRINGS STRINGS
aaaa.. ........0 aaaa... aaaa
bbb... ......100 bbb.... bbb
ccccc. .......21 ccccc.. ccccc
dddddd ........3 dddddd. dddddd
ee.... ......411 ee..... ee
ffff.. .....5111
gggggg 678993321 gggggg. gggggg
hhh... ..7666666 hhh.... hhh
* cleanup up scols_table_enable_maxout() use, example:
$ LIBSMARTCOLS_DEBUG_PADDING=on ./sample-scols-fromfile --nlines 10 --maxout --width 80 --column tests/ts/libsmartcols/files/col-name --column tests/ts/libsmartcols/files/col-number --column tests/ts/libsmartcols/files/col-string --column tests/ts/libsmartcols/files/col-string tests/ts/libsmartcols/files/data-string tests/ts/libsmartcols/files/data-number tests/ts/libsmartcols/files/data-string-empty tests/ts/libsmartcols/files/data-string-empty 2> /dev/null
NAME.............. ..................NUM STRINGS............ STRINGS............
aaaa.............. ....................0 aaaa............... aaaa...............
bbb............... ..................100 bbb................ bbb................
ccccc............. ...................21 ccccc.............. ccccc..............
dddddd............ ....................3 dddddd............. dddddd.............
ee................ ..................411 ee................. ee.................
ffff.............. .................5111 ................... ...................
gggggg............ ............678993321 gggggg............. gggggg.............
hhh............... ..............7666666 hhh................ hhh................
Note that we cannot make scols_table_enable_minout() default because
for example "column --table" is pretty commonly used with non-blank
columns separator and in this case all cells has to be filled.
$ echo -e "aa,b,ccc\na,,\naaa,bbb,ccc" | column --table --separator ',' --output-separator '|'
aa |b |ccc
a | |
aaa|bbb|ccc
Addresses: https://github.com/karelzak/util-linux/issues/826
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols/docs/libsmartcols-sections.txt')
-rw-r--r-- | libsmartcols/docs/libsmartcols-sections.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsmartcols/docs/libsmartcols-sections.txt b/libsmartcols/docs/libsmartcols-sections.txt index 72c4ab866..4f3178b3a 100644 --- a/libsmartcols/docs/libsmartcols-sections.txt +++ b/libsmartcols/docs/libsmartcols-sections.txt @@ -132,6 +132,7 @@ scols_table_enable_export scols_table_enable_header_repeat scols_table_enable_json scols_table_enable_maxout +scols_table_enable_minout scols_table_enable_noheadings scols_table_enable_nolinesep scols_table_enable_nowrap @@ -155,6 +156,7 @@ scols_table_is_export scols_table_is_header_repeat scols_table_is_json scols_table_is_maxout +scols_table_is_minout scols_table_is_noheadings scols_table_is_noencoding scols_table_is_nolinesep @@ -165,6 +167,7 @@ scols_table_move_column scols_table_new_column scols_table_new_line scols_table_next_column +scols_table_set_columns_iter scols_table_next_line scols_table_reduce_termwidth scols_table_remove_column |