summaryrefslogtreecommitdiffstats
path: root/text-utils
Commit message (Collapse)AuthorAgeFilesLines
* column: update column.1ahmogit2018-03-191-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: fix memory leak [coverity scan]Karel Zak2018-02-201-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: don't ignore space-char separators at begin of the lineKarel Zak2018-02-121-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | Non-space separator: $ echo -e ",col1,col2\nrow,1,2" | column -t -s "," --table-columns A,B,C A B C col1 col2 row 1 2 Space-char (\t) separator: $ echo -e "\tcol1\tcol2\nrow\t1\t2" | column -t -s "$(echo -e '\t')" --table-columns A,B,C A B C col1 col2 row 1 2 Fixed version: $ echo -e "\tcol1\tcol2\nrow\t1\t2" | column -t -s "$(echo -e '\t')" --table-columns A,B,C A B C col1 col2 row 1 2 Addresses: https://github.com/karelzak/util-linux/issues/575 Signed-off-by: Karel Zak <kzak@redhat.com>
* text-utils: use errexec()Karel Zak2018-02-012-4/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: fix typosSami Kerola2017-11-281-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* column: use \x<hex> for invalid multibyte seq.Karel Zak2017-11-222-3/+15
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/542 Signed-off-by: Karel Zak <kzak@redhat.com>
* column: allow to hide unnamed columnsKarel Zak2017-11-132-2/+35
| | | | | Addresses: https://github.com/karelzak/util-linux/pull/327 Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add --table-noheadingsKarel Zak2017-11-132-2/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: (-t) disable encoding for non-printable charsKarel Zak2017-07-311-1/+3
| | | | | | | | | $ echo -e '\033[34mBLUE{1\n\033[31mRED{2\n' | ./column -s '{' -t BLUE 1 RED 2 Addresses: https://github.com/karelzak/util-linux/issues/490 Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-2910-18/+18
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* column: fix compilation when libc lacks wide-character supportCarlos Santos2017-06-291-0/+8
| | | | | | | | | | | | | | | | Commit 4762ae9d removed mtsafe_strtok() but left behind calls to wcstok and wcspbrk. This leads to build failures when libc does not have the wide-character functions, like some uClibc builds. Solve the problem by using strtok_r and strpbrk when HAVE_WIDECHAR is not defined. Fixes: http://autobuild.buildroot.net/results/fd8a1a8e0cef3aeed9588540e8e663664f6b43aa http://autobuild.buildroot.net/results/5ad73ea8b471321988c50d80a5e50d4504151dd6 http://autobuild.buildroot.net/results/04411b7280dc51ecd51236967981a42352bbeb3e Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
* misc: consolidate all --help option descriptionsRuediger Meier2017-06-272-4/+6
| | | | | | | | Now we are always using the same text also for commands which had still hardcoded descriptions or where we can't use the standard print_usage_help_options macro. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-278-16/+8Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cosmetics, remove argument from usage(FILE*)Ruediger Meier2017-06-267-20/+25
| | | | | | | | | | | | | | This patch is trivial and changes nothing, because we were always using usage(stdout) Now all our usage() functions look very similar. If wanted we could auto-generate another big cosmetical patch to remove all the useless "FILE *out" constants and use printf and puts rather than their f* friends. Such patch could be automatically synchronized with the translation project (newlines!) to not make the translators sick. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cosmetics, remove argument from usage(int)Ruediger Meier2017-06-261-4/+4
| | | | | | | This patch is trivial and changes nothing, because we were always using usage(0). Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: never use usage(stderr)Ruediger Meier2017-06-261-5/+8
| | | | | | | Here we fix all cases where we have usage(FILE*) functions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: cleanup and fix --unknownopt issuesRuediger Meier2017-06-261-6/+7
| | | | | | | | | | | | | | | | Fixed checkusage.sh warnings: rtcwake: --unknownopt, non-empty stdout rtcwake: --unknownopt, stderr too long: 21 blockdev: --unknownopt, stderr too long: 28 lsipc: --unknownopt, stderr too long: 77 pg: --unknownopt, stderr too long: 23 renice: --unknownopt, stderr too long: 18 sulogin: --unknownopt, stderr too long: 17 write: --unknownopt, stderr too long: 12 Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* more: add --help and --versionRuediger Meier2017-06-222-7/+28
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: remove superfluous null pointer checks for optargRuediger Meier2017-06-221-1/+1
| | | | | | This is only needed for optional arguments. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* more: remove unused variableRuediger Meier2017-06-151-2/+1Star
| | | | | | | | | slow_tty is at least unused since util-linux 2.2. FYI here is another derived more.c where slow_tty is still used: https://github.com/sergev/LiteBSD/blob/master/old/more/more.c 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 ggc-7 fallthrough warningsSami Kerola2017-06-144-7/+8
| | | | | | | | | | | | | | | | | | | (Original patch and commit message edited by Rudi.) gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra. This warning can be silenced by using comment /* fallthrough */ which is also recognized by other tools like coverity. There are also other valid comments (see man gcc-7) but we consolidate this style now. We could have also used __attribute__((fallthrough)) but the comment looks nice and does not need to be ifdef'ed for compatibility. Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652 Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ Reviewed-by: Ruediger Meier <ruediger.meier@ga-group.nl> Suggested-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* column: add --table-header-repeatKarel Zak2017-06-132-2/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add missed semicolons in case of !HAVE_WIDECHARAlexander Kuleshov2017-06-011-2/+2
| | | | | | | | | | In other case we will get: error: expected ‘;’ before ‘}’ token error. Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
* build-sys: ncurses headers cleanupKarel Zak2017-05-313-17/+15Star
| | | | | | | | | * assume ncursesw headers in ncursesw/ directory only * prefer long paths, <term.h> and <ncurses.h> should be last possibility * fix typos Signed-off-by: Karel Zak <kzak@redhat.com>
* text-utils: use proper paths to term.hKarel Zak2017-05-303-4/+27
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: make column.1 example to use ascii outputSami Kerola2017-05-101-5/+5
| | | | | | In same go ease reading by having data and arguments in same order. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* col: avoid extra newline if no inputSami Kerola2017-05-101-0/+2
| | | | | | | | | BSD fix missed for 22 years, and all util-linux releases so far. Backported-from: https://github.com/dspinellis/unix-history-repo/commit/2a15260a2a3230e02f57c096fb4c5e1f797bf4f3 Addresses: https://github.com/karelzak/util-linux/issues/422 Reported-by: Pavel Raiskup <praiskup@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* column: be robust on empty tableKarel Zak2017-05-051-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: require column names for JSONKarel Zak2017-05-051-1/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: use libsmartcols to avoid circular dependencesKarel Zak2017-05-051-4/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add note that circular dependencies are ignoredKarel Zak2017-05-051-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add --tree to the man pageKarel Zak2017-05-051-3/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: fix --tree id-parent loop crashKarel Zak2017-05-051-1/+5
| | | | | | The loop is silently ignored. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove column-old.cKarel Zak2017-05-032-498/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: parent and child has to be independentKarel Zak2017-05-021-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: force to follow specified widthKarel Zak2017-05-021-2/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* columns: add note about widthKarel Zak2017-05-021-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: use NOEXTREMES for the last columnKarel Zak2017-05-022-1/+27
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add support for treesKarel Zak2017-05-021-1/+77
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: clean up man pageKarel Zak2017-05-021-20/+29
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: clean up usage() and options orderKarel Zak2017-05-021-37/+46
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add --table-orderKarel Zak2017-05-022-1/+38
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: fix typoKarel Zak2017-05-021-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add --table-hideKarel Zak2017-05-022-1/+13
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add --table-wrapKarel Zak2017-05-022-2/+17
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add --table-noextremeKarel Zak2017-05-022-6/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: add --table-truncateKarel Zak2017-05-022-13/+37
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: rename optionsKarel Zak2017-05-022-8/+8
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* column: fix greedy initializationKarel Zak2017-05-021-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>