X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Ftic.c;h=d40dde021bb0ed59e0953ae394999a7459f279c4;hp=739e7ed71ac4aa7fab979c6fdca22d176391e4a8;hb=b7f1cb3f5063cb3a371f8f1c25c24d03a892a429;hpb=c120fddebe9e9c1e2b29dbd744a6b1d03652bf8b diff --git a/progs/tic.c b/progs/tic.c index 739e7ed7..d40dde02 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -44,7 +44,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.150 2011/05/21 18:15:45 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.153 2011/09/26 23:50:46 tom Exp $") const char *_nc_progname = "tic"; @@ -74,6 +74,7 @@ f\ G\ g\ I\ +K\ L\ N\ r\ @@ -133,6 +134,7 @@ usage(void) #if NCURSES_XNAMES " -a retain commented-out capabilities (sets -x also)", #endif + " -K translate entries to termcap source form with BSD syntax", " -C translate entries to termcap source form", " -c check only, validate input without compiling or translating", " -e translate/compile only entries named by comma-separated list", @@ -487,6 +489,7 @@ main(int argc, char *argv[]) int sortmode = S_TERMINFO; /* sort_mode */ int width = 60; + int height = 65535; bool formatted = FALSE; /* reformat complex strings? */ bool literal = FALSE; /* suppress post-processing? */ int numbers = 0; /* format "%'char'" to/from "%{number}" */ @@ -514,6 +517,7 @@ main(int argc, char *argv[]) #if NCURSES_XNAMES use_extended_names(FALSE); #endif + _nc_strict_bsd = 0; /* * Processing arguments is a little complicated, since someone made a @@ -521,7 +525,7 @@ main(int argc, char *argv[]) * be optional. */ while ((this_opt = getopt(argc, argv, - "0123456789CILNR:TUVace:fGgo:rstvwx")) != -1) { + "0123456789CIKLNR:TUVace:fGgo:rstvwx")) != -1) { if (isdigit(this_opt)) { switch (last_opt) { case 'v': @@ -531,14 +535,29 @@ main(int argc, char *argv[]) width = (width * 10) + (this_opt - '0'); break; default: - if (this_opt != '1') + switch (this_opt) { + case '0': + last_opt = this_opt; + width = 65535; + height = 1; + break; + case '1': + last_opt = this_opt; + width = 0; + break; + default: usage(); - last_opt = this_opt; - width = 0; + } } continue; } switch (this_opt) { + case 'K': + _nc_strict_bsd = 1; + /* the initial version of -K in 20110730 fell-thru here, but the + * same flag is useful when reading sources -TD + */ + break; case 'C': capdump = TRUE; outform = F_TERMCAP; @@ -696,11 +715,11 @@ main(int argc, char *argv[]) smart_defaults ? outform : F_LITERAL, - sortmode, width, debug_level, formatted); + sortmode, width, height, debug_level, formatted); else if (capdump) dump_init(tversion, outform, - sortmode, width, debug_level, FALSE); + sortmode, width, height, debug_level, FALSE); /* parse entries out of the source file */ _nc_set_source(source_file);