]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libsmartcols: change "export" behavior, add "shellvar" flag
authorKarel Zak <kzak@redhat.com>
Fri, 11 Feb 2022 11:06:41 +0000 (12:06 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 11 Feb 2022 11:06:41 +0000 (12:06 +0100)
commit3b5db50f7321676db431566c418bf2fb556e7601
tree39829ab5ec4f087c1f5668ae42ca774aa07ff43a
parent6c62faf14927a4f8aeaf04c4d0117fa6bd37d6a2
libsmartcols: change "export" behavior, add "shellvar" flag

In version 2.37 the "export" output format automatically modifies
column names to be compatible with shell's requirements for variable
names. This change was backwardly incompatible for people who use for
example "lsblk -P" in non-shell environment.

It's painful to modify this behavior again in v2.38, but it seems
better to add a way how to control this behavior independently on
output format as it seems attractive feature for more use-cases.

This commit introduces scols_table_enable_shellvar() function to
enable/disable this feature.

It also introduces

scols_column_set_name
scols_column_get_name
scols_column_get_name_as_shellvar
scols_table_is_shellvar

to make it easy to work with column names.

Fixes: https://github.com/util-linux/util-linux/issues/1594
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/docs/libsmartcols-sections.txt
libsmartcols/samples/fromfile.c
libsmartcols/src/column.c
libsmartcols/src/libsmartcols.h.in
libsmartcols/src/libsmartcols.sym
libsmartcols/src/print.c
libsmartcols/src/smartcolsP.h
libsmartcols/src/table.c