[svn-commits] seanbright: trunk r728 - /trunk/menuselect.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 24 16:04:22 CDT 2010


Author: seanbright
Date: Wed Mar 24 16:04:19 2010
New Revision: 728

URL: http://svnview.digium.com/svn/menuselect?view=rev&rev=728
Log:
Add --enable-all and --disable-all command line arguments to menuselect.

Review: https://reviewboard.asterisk.org/r/587/

Modified:
    trunk/menuselect.c

Modified: trunk/menuselect.c
URL: http://svnview.digium.com/svn/menuselect/trunk/menuselect.c?view=diff&rev=728&r1=727&r2=728
==============================================================================
--- trunk/menuselect.c (original)
+++ trunk/menuselect.c Wed Mar 24 16:04:19 2010
@@ -1540,8 +1540,11 @@
 		{ "check-deps",       no_argument,       &check_deps, 1 },
 		{ "enable",           required_argument, 0,           'e' },
 		{ "enable-category",  required_argument, 0,           'E' },
+		{ "enable-all",       no_argument,       0,           'A' },
 		{ "disable",          required_argument, 0,           'd' },
 		{ "disable-category", required_argument, 0,           'D' },
+		{ "disable-all",      no_argument,       0,           'a' },
+
 		{ 0, 0, 0, 0 },
 	};
 	int do_menu = 1;
@@ -1550,6 +1553,7 @@
 	const char *enable_cat = NULL;
 	const char *disable = NULL;
 	const char *disable_cat = NULL;
+	int enable_all = 0, disable_all = 0;
 
 	if (open_debug()) {
 		exit(1);
@@ -1583,6 +1587,14 @@
 			disable_cat = optarg;
 			do_menu = 0;
 			break;
+		case 'A':
+			enable_all = 1;
+			do_menu = 0;
+			break;
+		case 'a':
+			disable_all = 1;
+			do_menu = 0;
+			break;
 		default:
 			break;
 		}
@@ -1657,6 +1669,14 @@
 		}
 	}
 
+	if (enable_all ^ disable_all) {
+		struct category *cat;
+
+		AST_LIST_TRAVERSE(&categories, cat, list) {
+			set_all(cat, enable_all);
+		}
+	}
+
 	if (!res)
 		res = generate_makeopts_file();
 




More information about the svn-commits mailing list