X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fdemo_terminfo.c;h=28c79f964100abe2315aab08343879cd6ef19ff7;hp=d9bf5540b60f0c9df221debfe737b76d55f982ee;hb=4ceb04b5e19df8964f98c7675d9448c205a2053e;hpb=a1e63be290fce9e589bc57c9f753be09e8ac0cc7 diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c index d9bf5540..28c79f96 100644 --- a/test/demo_terminfo.c +++ b/test/demo_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2009-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 2009-2012,2013 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_terminfo.c,v 1.15 2012/12/29 23:36:22 tom Exp $ + * $Id: demo_terminfo.c,v 1.16 2013/01/19 19:30:58 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -325,6 +325,7 @@ usage(void) " -s print string-capabilities", #ifdef NCURSES_VERSION " -x print extended capabilities", + " -y disable extended capabilities", #endif }; unsigned n; @@ -341,8 +342,11 @@ main(int argc, char *argv[]) int repeat; char *name; int r_opt = 1; +#ifdef NCURSES_VERSION + bool xy_opt = TRUE; /* by default, use_extended_names is true */ +#endif - while ((n = getopt(argc, argv, "bd:e:fnqr:sx")) != -1) { + while ((n = getopt(argc, argv, "bd:e:fnqr:sxy")) != -1) { switch (n) { case 'b': b_opt = TRUE; @@ -372,7 +376,10 @@ main(int argc, char *argv[]) #ifdef NCURSES_VERSION case 'x': x_opt = TRUE; - use_extended_names(TRUE); + xy_opt = TRUE; + break; + case 'y': + xy_opt = FALSE; break; #endif default: @@ -381,6 +388,10 @@ main(int argc, char *argv[]) } } +#ifdef NCURSES_VERSION + use_extended_names(xy_opt); +#endif + if (!(b_opt || n_opt || s_opt || x_opt)) { b_opt = TRUE; n_opt = TRUE;