summaryrefslogtreecommitdiffstats
path: root/libsmartcols
Commit message (Collapse)AuthorAgeFilesLines
* libsmartcols: fix docs warningsKarel Zak2018-02-212-1/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'maybe-for-v2.32' of https://github.com/rudimeier/util-linuxKarel Zak2018-02-162-2/+2
|\ | | | | | | | | | | | | | | | | * 'maybe-for-v2.32' of https://github.com/rudimeier/util-linux: tests: use pgrep instead of ps --ppid ... misc: fix typos using codespell lsns: fix clang compiler warning tests: add udevadm settle to sfdisk/resize build-sys: disable bz2 tarball and fix some am warnings
| * misc: fix typos using codespellRuediger Meier2018-02-162-2/+2
| | | | | | | | | | | | Some more funny typos, please review carefully. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | libsmartcols: fixes issue with 0 width columnstaiyu2018-02-151-0/+4
| | | | | | | | | | | | | | | | [kzak@redhat.com: - it's possible that column has zero width when minimal width is reduced due to very small terminal. In this case make sure that we do not use such column at all.] Signed-off-by: Karel Zak <kzak@redhat.com>
* | libsmartcols: set minimal column width to 1Karel Zak2018-02-151-0/+2
| | | | | | | | | | | | | | | | | | The default is to use header width or relative width setting as the minimal column width. The problem are columns where is no header or relative width. Let's set minimal width to 1 in this case. Addresses: https://github.com/karelzak/util-linux/pull/577 Signed-off-by: Karel Zak <kzak@redhat.com>
* | libsmartcols: interpret zero width for pending data as errorKarel Zak2018-02-151-1/+4
|/ | | | | | | | | | | | | The command $ column -t -W2 -c11 <<< "cat dog bird" causes finite loop, because there is no minimal column width (missing header). The print functions should be robust enough to return -EINVAL when nonsense is requested. Addresses: https://github.com/karelzak/util-linux/pull/577 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: remove %p from debug messagesKarel Zak2018-02-015-17/+13Star
| | | | | | From libs where suid program may be executed by non-root user. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove redundant EXTRA_DIST filesRuediger Meier2018-01-221-2/+1Star
| | | | | | | The sources of AC_CONFIG_FILES (*.in) are automatically distributed. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: avoid using prog_DEPENDENCIESRuediger Meier2018-01-221-2/+1Star
| | | | | | | Use EXTRA_prog_DEPENDENCIES to have the benefit of automake's automatic prog_DEPENDENCIES. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: remove unneeded dependencies on bla.h.inRuediger Meier2018-01-221-2/+1Star
| | | | | | | | | | We have already automakes's automatic dependencies like bla.h.in -> bla.h -> foo.o -> bar.la An explicit direct dependency bla.h.in -> bar.la is redundant and useless anyways. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: automake is able to find headers in builddir ...Ruediger Meier2018-01-221-1/+1
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* build-sys: remove generated headers from dist tar ballRuediger Meier2018-01-221-4/+1Star
| | | | | | | | | | | | | Headers should only be listed in either *_HEADERS or *_SOURCES, especially when we want nodist_*_HEADERS. Since all the generated headers are made by configure we don't even need to use BUILT_SOURCES or other tricks. Also see automake docs 9.4.1 Built Sources Example: case "Build bindir.h from configure" Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()Karel Zak2018-01-171-1/+1
| | | | | | | Let's make it possible to use debug.h without environment variables. Suggested-by: J William Piggott <elseifthen@gmx.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* include/debug: don't print pointer address for SUID programsKarel Zak2018-01-121-0/+3
| | | | | | | | | | | | | | | | * introduce new flag __UL_DEBUG_FL_NOADDR to suppress pointer address printing * use __UL_DEBUG_FL_NOADDR when SUID * move ul_debugobj() to debugobj.h, and require UL_DEBUG_CURRENT_MASK to provide access to the current mask from ul_debugobj(). It's better than modify all ul_debugobj() calls and use the global mask as argument. * remove never used UL_DEBUG_DEFINE_FLAG Reported-by: halfdog <me@halfdog.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: don't add blank padding after left aligned titleKarel Zak2017-12-121-4/+12
| | | | | | | | | Let's use the same semantic for the title as for the last column in the table. If aligned on left, table is not "maxout" and title padding symbol is undefined (or blank) then keep title as short as possible. Addresses: https://github.com/karelzak/util-linux/issues/549 Signed-off-by: Karel Zak <kzak@redhat.com>
* sample-scols-title: add left title without paddingKarel Zak2017-12-121-2/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix typosSami Kerola2017-11-281-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: fix mem-leaks in samplesKarel Zak2017-11-232-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: (sample) cleanup line separator usageKarel Zak2017-10-122-4/+14
| | | | | | | | | | | | * add comment to explain when nolinesep flag is necessary * force to print \n before switch to the next line to support ./sample-scols-continuous > file use case. Addresses: https://github.com/ignatenkobrain/python-smartcols/issues/18 Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: (docs) add note about line separatorsKarel Zak2017-10-121-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: don't call free_buffer() for uninitialized variable [coverity ↵Karel Zak2017-10-111-2/+3
| | | | | | scan] Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix scols_line_move_cells() n+1 error [asan]Karel Zak2017-09-181-2/+2
| | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix heap-buffer-overflow when move columnsKarel Zak2017-09-151-4/+6
| | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix comment (to make gtk-docs happy)Karel Zak2017-07-311-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_table_enable_noencoding()Karel Zak2017-07-316-18/+76
| | | | | | | | Now the library encode all output. It seems too strict and difficult to use the library for some use-cases -- for example if you want to use the library for already colorized output (by esc.sequences). Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: never use usage(stderr)Ruediger Meier2017-06-261-4/+5
| | | | | | | Here we fix all cases where we have usage(FILE*) functions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: remove stray semicolonsSami Kerola2017-06-141-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: fix reassigned values before old ones has been used [cppcheck]Sami Kerola2017-06-141-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: fix warning "unused parameter"Ruediger Meier2017-06-131-2/+7
| | | | | | Noticed on OSX. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libsmartcols: (docs) add new functionsKarel Zak2017-06-131-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add header-repeat featureKarel Zak2017-06-135-3/+67
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add missing symbolsKarel Zak2017-06-121-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_table_{set,get}_termheight()Karel Zak2017-06-123-3/+42
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/ttyutils: return terminal lines tooKarel Zak2017-06-121-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix library order when linkingRuediger Meier2017-06-011-1/+1
| | | | | | | | | | We got some errors on Alpine Linux where $LTLIBINTL is non-empty: ./.libs/libcommon.a(libcommon_la-blkdev.o): In function `open_blkdev_or_file': lib/blkdev.c:282: undefined reference to `libintl_gettext collect2: error: ld returned 1 exit status Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libsmartcols: (docs) add missing 'since' tagsKarel Zak2017-05-234-2/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: check scols_table_set_default_symbols() return code [coverity ↵Karel Zak2017-05-171-1/+3
| | | | | | scan] Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_line_is_ancestor()Karel Zak2017-05-054-0/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add debug mesg to see width changeKarel Zak2017-05-021-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix typoKarel Zak2017-04-131-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_sort_table_by_tree()Karel Zak2017-04-134-2/+57
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: fix relative width interpretationKarel Zak2017-04-072-5/+5
| | | | | | The non-defined width hint (=0) should not be interpreted as relative width. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: column width reduction refactoringKarel Zak2017-04-072-32/+80
| | | | | | | The current implementation is unreadable... Let's write it again with more obvious semantic. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_line_move_cells()Karel Zak2017-04-073-3/+50
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: add scols_table_move_column()Karel Zak2017-04-074-0/+35
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: do not use plain 0 as NULL [smatch scan]Sami Kerola2017-03-173-25/+25
| | | | | | Likewise commit 87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: fix test variable shadowingSami Kerola2017-03-171-5/+5
| | | | | | | | | | libsmartcols/samples/fromfile.c:57:16: warning: declaration of 'flags' shadows a global declaration [-Wshadow] libsmartcols/samples/fromfile.c:29:33: note: shadowed declaration is here libsmartcols/samples/fromfile.c:101:8: warning: declaration of 'flags' shadows a global declaration [-Wshadow] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libsmartcols: allow to add column to already used tableKarel Zak2017-03-031-7/+18
| | | | | | | | Now it's impossible to add new column if the table already contains lines with data. This patch forces library to realloc cell array in the lines to accept a new column. Signed-off-by: Karel Zak <kzak@redhat.com>
* libsmartcols: support columns separators greater than one output cellKarel Zak2017-03-022-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: Fix word repetitionsYuri Chornoivan2017-02-131-1/+1
|