Commit Graph

318 Commits

Author SHA1 Message Date
Karel Zak de30626495 libsmartcols: make sure boolean is true/false only
.. and never "null".

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-05 12:12:25 +02:00
Karel Zak b2c871f978 libsmartcols: improve JSON support (add types)
This commit add SCOLS_JSON_{NUMBER,STRING,BOOLEAN} to specify column
type for JSON output formatting.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-03 15:10:10 +02:00
Karel Zak ab0ede8619 libsmartcols: (docs) update year
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-03-20 18:55:36 +01:00
Karel Zak aef70f5514 libsmartcols: fix docs warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-21 13:23:19 +01:00
Karel Zak 7595bed189 Merge branch 'maybe-for-v2.32' of https://github.com/rudimeier/util-linux
* '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
2018-02-16 11:25:22 +01:00
Ruediger Meier 73afd3f8e8 misc: fix typos using codespell
Some more funny typos, please review carefully.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-02-16 11:12:52 +01:00
taiyu 0f9b4f2f3a libsmartcols: fixes issue with 0 width columns
[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>
2018-02-15 12:27:23 +01:00
Karel Zak 0f9f927b6f libsmartcols: set minimal column width to 1
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>
2018-02-15 12:20:17 +01:00
Karel Zak 19b10b8978 libsmartcols: interpret zero width for pending data as error
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>
2018-02-15 11:58:41 +01:00
Karel Zak 63c9c05d35 misc: remove %p from debug messages
From libs where suid program may be executed by non-root user.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-01 13:18:57 +01:00
Ruediger Meier af1bc027db build-sys: remove redundant EXTRA_DIST files
The sources of AC_CONFIG_FILES (*.in) are automatically
distributed.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 4beacf105e build-sys: avoid using prog_DEPENDENCIES
Use EXTRA_prog_DEPENDENCIES to have the benefit
of automake's automatic prog_DEPENDENCIES.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 0da03d4490 build-sys: remove unneeded dependencies on bla.h.in
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>
2018-01-22 11:16:49 +01:00
Ruediger Meier a459f2ec33 build-sys: automake is able to find headers in builddir ...
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-01-22 11:16:49 +01:00
Ruediger Meier 1d667d8849 build-sys: remove generated headers from dist tar ball
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>
2018-01-22 11:16:49 +01:00
Karel Zak a15dca2f6d include/debug: introduce __UL_INIT_DEBUG_FROM_STRING()
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>
2018-01-17 13:58:29 +01:00
Karel Zak 6d00cfb233 include/debug: don't print pointer address for SUID programs
* 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>
2018-01-12 11:01:26 +01:00
Karel Zak 3fa48b118a libsmartcols: don't add blank padding after left aligned title
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>
2017-12-12 13:19:36 +01:00
Karel Zak 8aeda56b5d sample-scols-title: add left title without padding
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-12-12 13:16:54 +01:00
Sami Kerola fcf841f8d3 misc: fix typos
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-11-28 14:39:13 +01:00
Karel Zak d1bf0ce5fa libsmartcols: fix mem-leaks in samples
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-11-23 15:24:59 +01:00
Karel Zak f086478af4 libsmartcols: (sample) cleanup line separator usage
* 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>
2017-10-12 12:03:57 +02:00
Karel Zak 1e46776263 libsmartcols: (docs) add note about line separators
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 11:33:49 +02:00
Karel Zak a30f2a9b7a libsmartcols: don't call free_buffer() for uninitialized variable [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 15:06:41 +02:00
Karel Zak 7928a926a0 libsmartcols: fix scols_line_move_cells() n+1 error [asan]
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-18 10:41:20 +02:00
Karel Zak 1ed968c526 libsmartcols: fix heap-buffer-overflow when move columns
Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-15 13:43:54 +02:00
Karel Zak c43874baa6 libsmartcols: fix comment (to make gtk-docs happy)
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-07-31 13:33:11 +02:00
Karel Zak 28a3cc83c5 libsmartcols: add scols_table_enable_noencoding()
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>
2017-07-31 11:45:23 +02:00
Ruediger Meier 6e1eda6f22 misc: never use usage(stderr)
Here we fix all cases where we have usage(FILE*)
functions.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-26 14:38:24 +02:00
Sami Kerola f4d3783867 misc: remove stray semicolons
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-06-14 12:21:29 +02:00
Sami Kerola 1b5042636f misc: fix reassigned values before old ones has been used [cppcheck]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-06-14 12:19:20 +02:00
Ruediger Meier 59879322e6 libsmartcols: fix warning "unused parameter"
Noticed on OSX.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-13 23:39:22 +02:00
Karel Zak f12e437436 libsmartcols: (docs) add new functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-13 11:17:06 +02:00
Karel Zak 36e07cebf1 libsmartcols: add header-repeat feature
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-13 11:11:17 +02:00
Karel Zak 5df8f14c30 libsmartcols: add missing symbols
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-12 16:35:58 +02:00
Karel Zak e33b387483 libsmartcols: add scols_table_{set,get}_termheight()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-12 11:51:36 +02:00
Karel Zak f46a8d7e66 lib/ttyutils: return terminal lines too
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-12 11:38:38 +02:00
Ruediger Meier c0d7b11a3f build-sys: fix library order when linking
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>
2017-06-01 03:16:48 +02:00
Karel Zak 4ab60277cb libsmartcols: (docs) add missing 'since' tags
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-23 13:27:29 +02:00
Karel Zak 1ce46fcf6b libsmartcols: check scols_table_set_default_symbols() return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-17 12:50:36 +02:00
Karel Zak eebf2dd89b libsmartcols: add scols_line_is_ancestor()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-05 12:12:43 +02:00
Karel Zak 7e2a4ef700 libsmartcols: add debug mesg to see width change
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-05-02 12:18:00 +02:00
Karel Zak c8341f418a libsmartcols: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-13 11:47:43 +02:00
Karel Zak 066f46e0ee libsmartcols: add scols_sort_table_by_tree()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-13 11:19:59 +02:00
Karel Zak 14cd0a67a3 libsmartcols: fix relative width interpretation
The non-defined width hint (=0) should not be interpreted as relative width.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-07 14:34:11 +02:00
Karel Zak f691831481 libsmartcols: column width reduction refactoring
The current implementation is unreadable... Let's write it again with
more obvious semantic.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-07 14:34:11 +02:00
Karel Zak 48645e7bbb libsmartcols: add scols_line_move_cells()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-07 14:34:11 +02:00
Karel Zak 7bdefc7fc0 libsmartcols: add scols_table_move_column()
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-04-07 14:34:11 +02:00
Sami Kerola 71f08e9706
tests: do not use plain 0 as NULL [smatch scan]
Likewise commit 8791804065.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-03-17 21:22:26 +00:00
Sami Kerola 4ff3d13b43
libsmartcols: fix test variable shadowing
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>
2017-03-17 21:22:26 +00:00
Karel Zak 1765814521 libsmartcols: allow to add column to already used table
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>
2017-03-03 10:37:37 +01:00
Karel Zak c14224b374 libsmartcols: support columns separators greater than one output cell
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-03-02 16:56:39 +01:00
Yuri Chornoivan a7349ee315 docs: Fix word repetitions 2017-02-13 14:10:12 +01:00
Karel Zak 6ffbd28359 libsmartcols: add scols_cell_get_alignment()
Just to hide that we use cell flags (bitwise operations) to define
cell content alignment. The patch also more explicitly specifies the
flags in the header file.

The alignment is evaluated in the order: right, center, left. The
default is left.

Note that SCOLS_CELL_FL_* are used for for table title only.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-09 13:28:24 +01:00
Karel Zak efc0795811 Merge branch 'ignatenko/libsmartcols-dead' of https://github.com/ignatenkobrain/util-linux
* 'ignatenko/libsmartcols-dead' of https://github.com/ignatenkobrain/util-linux:
  libsmartcols: remove dead checks
2017-01-09 13:07:37 +01:00
Karel Zak 1f408f0220 libsmartcols: unused parameter [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-01-05 12:31:26 +01:00
Igor Gnatenko 16e64b6822 libsmartcols: remove dead checks
We initialize them before.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 23:36:48 +01:00
Sébastien Helleu d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Ruediger Meier 12f17a23df misc: fix typos using codespell
# command used was:
 $ ~/src/codespell/codespell \
   -w -D /home/rudi/src/codespell/build/lib/codespell_lib/data/dictionary.txt \
   $(git ls-files | grep -v "^po/\|\.xz$\|\.gz$\|\.bz2$\|\.img$\|^Documentation/releases/")

 BTW some manually grammer fixes:
   s/uses/used/
   s/begin/beginning/

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-01 00:01:43 +01:00
Karel Zak 95a528ddbc libsmartcols: make scols_sort_table() usable for trees
We also need to sort children when tree is enabled.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-02 14:39:08 +01:00
Ruediger Meier 332123f2b6 misc: fix some compiler warnings
libsmartcols/samples/fromfile.c:59:2: warning: passing argument 3 of 'string_to_bitmask' from incompatible pointer type
  text-utils/pg.c:79:0: warning: "TABSIZE" redefined
  libblkid/src/read.c:455:13: warning: 'debug_dump_dev' defined but not used [-Wunused-function]
  libblkid/src/probe.c:769:13: warning: unused function 'cdrom_size_correction' [-Wunused-function]
  /usr/include/sys/termios.h:3:2: warning: "this file includes <sys/termios.h> which is deprecated, use <termios.h> instead" [-W#warnings]

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-10-27 11:03:24 +02:00
Karel Zak 82053f5e3d libsmartcols: add scols_column_add_width()
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-30 11:01:41 +02:00
Karel Zak 68a7f92b94 libsmartcols: custom wrap fixes
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-27 14:16:18 +02:00
Karel Zak 81b176c4da docs: some random fixes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-27 12:52:47 +02:00
Karel Zak 3f47320a17 libsmartcols: (docs) add missing version notes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-27 11:35:43 +02:00
Igor Gnatenko 618a1d6dbe libsmartcols: fixes in doc generation
* Add 2.29 symbols index
* Sync argument names between header and implementation

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-27 11:19:03 +02:00
Karel Zak 949ea05f1a libsmartcols: support custom wrap and remove SCOLS_FL_WRAPNL
This new API provides full control on multi-line cells, you can wrap
text by new lines (build-in support) or by another way (after words,
commas, etc.) Changes:

* new scols_column_set_wrapfunc() sets pointers to two callback functions

   1/ chunksize() - returns largest data chunk size; used when we
                    calculate columns width
   2/ nextchunk() - terminate the current chunk and returns pointer to
                    the next; used when we print data

* remove SCOLS_FL_WRAPNL and add new functions scols_wrapnl_chunksize()
  and scols_wrapnl_nextchunk() to provide build-in functionality to
  wrap cells on \n

* remove scols_column_is_wrapnl() add scols_column_is_customwrap()
  (returns true if custom wrap functions are defined)

* add scols_column_set_safechars() and scols_column_get_safechars() to
  allow to control output encoding, safe chars are not encoded by \xFOO

* modify "fromfile" test code to use build-in scols_wrapnl_* callbacks
  for "wrapnl" tests

* add new function scols_column_get_table()

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-26 11:20:07 +02:00
Karel Zak 0d71eb9c4b libsmartcols: (docs) add missing functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 14:31:06 +02:00
Karel Zak a3b91e82f2 Merge branch 'getters' of https://github.com/ignatenkobrain/util-linux
* 'getters' of https://github.com/ignatenkobrain/util-linux:
  libsmartcols: add scols_table_is_nolinesep()
  libsmartcols: add scols_table_is_nowrap()
  libsmartcols: add scols_table_get_name()
2016-09-23 14:25:37 +02:00
Igor Gnatenko 43e06c67f9 libsmartcols: add scols_table_is_nolinesep()
And save 1 or 0 into tb->no_linesep instead of any value.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 14:21:15 +02:00
Igor Gnatenko 8427c2ec9c libsmartcols: add scols_table_is_nowrap()
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 14:20:41 +02:00
Karel Zak 63168cf9b5 libsmartcols: cleanup scols_table_set_symbols() API
Change behavior:
  * scols_table_set_symbols(tb, NULL) remove reference to the current symbols setting
    and does not set default symbols at all

Add new functions:
  * scols_table_get_symbols()
  * scols_table_set_default_symbols()

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-23 14:20:24 +02:00
Igor Gnatenko 9696071737 libsmartcols: add scols_table_get_name()
Currently we have scols_table_set_name() but don't have getter for it.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 14:11:34 +02:00
Igor Gnatenko e0140aa138 libsmartcols: use const qualifier for scols_table_get_termwidth
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-23 11:27:35 +02:00
Karel Zak 266eecd54e Merge branch 'api_const' of https://github.com/ignatenkobrain/util-linux
* 'api_const' of https://github.com/ignatenkobrain/util-linux:
  libsmartcols: use const qualifier where it's possible
  debug: use const void * for ul_debugobj()
  libsmartcols: make get_line/column_separator() return const
2016-09-23 11:14:15 +02:00
Karel Zak 02aaba6f9f libsmartcols: keep scols_table_get_termwidth() read-only
Addresses: https://github.com/karelzak/util-linux/issues/356
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-22 13:47:23 +02:00
Igor Gnatenko f7a9ea28ef libsmartcols: use const qualifier where it's possible
Closes: https://github.com/karelzak/util-linux/issues/355
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-21 08:36:00 +02:00
Igor Gnatenko 0e0943c15b debug: use const void * for ul_debugobj()
We don't modify data it's pointing out and we should not modify it.

Also remove casting to void * as gcc will do it automatically (before
we had to cast it explicitly to avoid warning on discarding 'const'
qualifier).

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-21 08:22:35 +02:00
Igor Gnatenko 6f9377ab81 libsmartcols: make get_line/column_separator() return const
The patch introduces tiny API changes (char * -> const char *) for
    scols_table_get_line_separator
    scols_table_get_column_separator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-21 07:26:44 +02:00
Karel Zak 8f0c12f1c9 Merge branch 'hotfix' of https://github.com/ignatenkobrain/util-linux 2016-09-19 14:21:18 +02:00
Karel Zak ffd1325ddd Merge branch 'typos' of https://github.com/ignatenkobrain/util-linux
* 'typos' of https://github.com/ignatenkobrain/util-linux:
  libsmartcols: fix typos in docs
2016-09-19 14:20:37 +02:00
Igor Gnatenko 4fb899ed77 libsmartcols: be consistent, use 'sy' for symbols
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-19 14:13:51 +02:00
Igor Gnatenko bfc6941ae7 libsmartcols: fix typos in docs
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-19 14:13:38 +02:00
Karel Zak 4e91ebca3e libsmartcols: be more strict about empty tables
and don't print extra \n for empty table.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-19 14:07:38 +02:00
Karel Zak 166897ceb3 libsmartcols: fix comment
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-19 13:48:42 +02:00
Karel Zak d4275a4bde libsmartcols: cleanup get functions
The patch introduces tiny API changes (int -> size_t) for

	scols_table_get_ncols
	scols_table_get_nlines

Addresses: https://github.com/karelzak/util-linux/issues/349
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-19 13:39:03 +02:00
Karel Zak 695fd479be tests: add columns separator to libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 14:18:01 +02:00
Karel Zak 4a2b50f238 tests: add export and raw to libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:49:37 +02:00
Karel Zak 6a82714dbf libsmartcols: add JSON support to sample application
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:30:29 +02:00
Karel Zak 65f3ebc334 libsmartcols: improve JSON
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:22:47 +02:00
Karel Zak 346e3a40a0 libsmartcols: cleanup line separator usage
* use line separator only to separate lines, not after last line
 * explicitly print \n after table in scols_print_table()
 * don't terminate table by \n or line separator in scols_print_table_to_string()

Note that the patch is little bit trick due to impact to the trees
printing. Now print_tree_line() should be more readable.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-16 13:00:47 +02:00
Karel Zak 9aca40bbec libsmartcols: fix tree padding
We cannot use cell-padding char with in tree ASCII art, because
tree uses two chars rather than one.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-15 12:22:12 +02:00
Karel Zak 18ff51547d libsmartcols: add support for trees to the sample application
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-15 12:12:18 +02:00
Karel Zak 54c6de3d04 Merge branch 'patch-1' of https://github.com/ignatenkobrain/util-linux 2016-09-15 10:05:15 +02:00
Igor Gnatenko 8e7d9d231e trivial: s/automatical/automatic/g
"Automatical" is archaic form of "automatic".

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-09-14 19:36:51 +02:00
Igor Gnatenko 937e045855 smartcols/symbols: free cell_padding in unref()
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2016-09-14 17:10:14 +02:00
Karel Zak 36eb51ebb4 tests: add libsmartcols title test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-14 12:49:46 +02:00
Karel Zak fdf7279849 libsmartcols: fix hidden file usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-14 12:37:53 +02:00
Karel Zak 6db10580ca build-sys: remove dead libsmartcols sample
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 16:50:10 +02:00
Karel Zak a414a17093 tests: improve libsmartcols test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 14:12:11 +02:00