From 1e4cb6cae92d8cd2070d9388d10b0e01d6cf8f68 Mon Sep 17 00:00:00 2001 From: Eric Molitor Date: Wed, 3 Jul 2019 09:33:33 +0100 Subject: nl: nl -v Implement nl -v supporting negative and zero starting values. --- toys/posix/nl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'toys/posix') diff --git a/toys/posix/nl.c b/toys/posix/nl.c index b9e60ae2..1b7b390a 100644 --- a/toys/posix/nl.c +++ b/toys/posix/nl.c @@ -5,15 +5,15 @@ * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/nl.html * * This implements a subset: only one logical page (-ip), no sections (-dfh). - * todo: -lv + * todo: -l -USE_NL(NEWTOY(nl, "v#<1=1l#w#<0=6Eb:n:s:", TOYFLAG_USR|TOYFLAG_BIN)) +USE_NL(NEWTOY(nl, "v#=1l#w#<0=6Eb:n:s:", TOYFLAG_USR|TOYFLAG_BIN)) config NL bool "nl" default y help - usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-w WIDTH] [FILE...] + usage: nl [-E] [-l #] [-b MODE] [-n STYLE] [-s SEPARATOR] [-v #] [-w WIDTH] [FILE...] Number lines of input. @@ -22,6 +22,7 @@ config NL -l Only count last of this many consecutive blank lines -n Number STYLE: ln (left justified) rn (right justified) rz (zero pad) -s Separator to use between number and line (instead of TAB) + -v Starting line number for each section (default 1) -w Width of line numbers (default 6) */ -- cgit v1.2.3