changeset 192:8ae2670377ca

Added hidden options to lw_cmdline
author lost@l-w.ca
date Fri, 13 Jan 2012 21:33:55 -0700
parents ddffceb3c331
children 68f41eaf44f2
files lwlib/lw_cmdline.c lwlib/lw_cmdline.h
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/lw_cmdline.c	Fri Jan 13 21:28:34 2012 -0700
+++ b/lwlib/lw_cmdline.c	Fri Jan 13 21:33:55 2012 -0700
@@ -103,6 +103,8 @@
 	t = 0;
 	for (i = 0; i < nopt + 3; i++)
 	{
+		if (slist[i]->flags & lw_cmdline_opt_hidden)
+			continue;
 		if (slist[i]->key > 0x20 && slist[i]->key < 0x7f)
 		{
 			if (slist[i]->arg == NULL)
@@ -127,6 +129,8 @@
 	/* print short options that take args */
 	for (i = 0; i < nopt + 3; i++)
 	{
+		if (slist[i]->flags & lw_cmdline_opt_hidden)
+			continue;
 		if (slist[i]->key > 0x20 && slist[i]->key < 0x7f && slist[i] -> arg)
 		{
 			if (slist[i]->flags & lw_cmdline_opt_optional)
@@ -157,6 +161,8 @@
 	/* print long options */
 	for (i = 0; i < nopt + 3; i++)
 	{
+		if (slist[i]->flags & lw_cmdline_opt_hidden)
+			continue;
 		if (!(llist[i]->name))
 			continue;
 		if (llist[i]->arg)
@@ -264,6 +270,8 @@
 	/* display options - do it the naïve way for now */
 	for (i = 0; i < (nopt + 3); i++)
 	{
+		if (llist[i]->flags & lw_cmdline_opt_hidden)
+			continue;
 		noequ = 0;
 		if (llist[i] -> flags & lw_cmdline_opt_doc)
 		{
--- a/lwlib/lw_cmdline.h	Fri Jan 13 21:28:34 2012 -0700
+++ b/lwlib/lw_cmdline.h	Fri Jan 13 21:33:55 2012 -0700
@@ -44,7 +44,7 @@
 enum
 {
 	lw_cmdline_opt_optional = 1,
-/*	lw_cmdline_opt_hidden = 2,*/
+	lw_cmdline_opt_hidden = 2,
 /*	lw_cmdline_opt_alias = 4,*/
 /*	lw_cmdline_opt_nousage = 0x10,*/
 	lw_cmdline_opt_doc = 0x80