expand,unexpand: support specifying a trailing tab size
commitb1413b6011cd368fb4244f0aa79f4c4ea5ab50c5
authorPádraig Brady <P@draigBrady.com>
Sun, 26 Feb 2017 22:40:19 +0000 (26 14:40 -0800)
committerPádraig Brady <P@draigBrady.com>
Wed, 1 Mar 2017 03:26:01 +0000 (28 19:26 -0800)
treeb3e28d75e6c0ac80ed08cd7fd5558ad3111125da
parent9404382f6b98606f98b5cd736f5bf6b0aff9d1e7
expand,unexpand: support specifying a trailing tab size

* doc/coreutils.texi (expand invocation): Document the feature.
(unexpand invocation): Likewise.
* src/expand-common.c (extend_size): A new global to use
when the last tab stop is prefixed by '/'.
(set_extend_size): A new function to validate and set
the new extend_size global.
(parse_tab_stops): Call set_extend_size() for '/' prefixes.
(finalize_tab_stops): Ensure a single specified '/' is
treated like a standard tabsize, but also ensure that
when '/' is specified with a single other entry that
we process as a list rather than a tab size.
(get_next_tab_stop): Use the tab size if set,
for items after the user specified tab position list.
* tests/misc/expand.pl: Add test cases
* NEWS: Mention the new feature.
Fixes http://bugs.gnu.org/25540
NEWS
doc/coreutils.texi
src/expand-common.c
tests/misc/expand.pl