From 0200c80155358d57706d80895007f38b36e035ea Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 30 Apr 2011 13:06:27 +0200 Subject: ul.c: warn user when command chooses term type Happens usually when user specifies garbage as -t argument. Signed-off-by: Sami Kerola Signed-off-by: Karel Zak --- text-utils/ul.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/text-utils/ul.c b/text-utils/ul.c index 42a2ee279..1cbacfc07 100644 --- a/text-utils/ul.c +++ b/text-utils/ul.c @@ -147,7 +147,7 @@ usage(FILE *out) int main(int argc, char **argv) { - int c, ret; + int c, ret, tflag = 0; char *termtype; FILE *f; @@ -184,6 +184,7 @@ int main(int argc, char **argv) case 'T': /* for nroff compatibility */ termtype = optarg; + tflag = 1; break; case 'i': iflag = 1; @@ -209,7 +210,9 @@ int main(int argc, char **argv) /* fall through to ... */ case 0: - /* No such terminal type - assume dumb */ + if (tflag) + warnx(_("terminal `%s' is not known, defaulting to `dumb'"), + termtype); setupterm("dumb", STDOUT_FILENO, (int *)0); break; } -- cgit v1.2.3-55-g7522