From a414a1709387298c633d0f549bde5d0459b43a31 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 13 Sep 2016 14:12:11 +0200 Subject: tests: improve libsmartcols test Signed-off-by: Karel Zak --- libsmartcols/samples/fromfile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libsmartcols/samples') diff --git a/libsmartcols/samples/fromfile.c b/libsmartcols/samples/fromfile.c index 361de01c7..ec12267a6 100644 --- a/libsmartcols/samples/fromfile.c +++ b/libsmartcols/samples/fromfile.c @@ -156,6 +156,7 @@ int main(int argc, char *argv[]) { "maxout", 0, 0, 'm' }, { "column", 1, 0, 'c' }, { "nlines", 1, 0, 'n' }, + { "width", 1, 0, 'w' }, { NULL, 0, 0, 0 }, }; @@ -167,7 +168,7 @@ int main(int argc, char *argv[]) if (!tb) err(EXIT_FAILURE, "failed to create output table"); - while((c = getopt_long(argc, argv, "c:mn:", longopts, NULL)) != -1) { + while((c = getopt_long(argc, argv, "c:mn:w:", longopts, NULL)) != -1) { switch(c) { case 'c': /* add column from file */ { @@ -189,6 +190,10 @@ int main(int argc, char *argv[]) case 'n': nlines = strtou32_or_err(optarg, "failed to parse number of lines"); break; + case 'w': + scols_table_set_termforce(tb, SCOLS_TERMFORCE_ALWAYS); + scols_table_set_termwidth(tb, strtou32_or_err(optarg, "failed to parse terminal width")); + break; default: err(EXIT_FAILURE, "%s [-r|--random]\n", program_invocation_short_name); } -- cgit v1.2.3-55-g7522