Browse code

core: added option '-a' to control auto aliases

- enable auto aliases with '-a yes' or -'-a on'
- disable auto aliases with '-a no' or -'-a off'
- the option overwirtes config value of global parameter auto_aliases

Daniel-Constantin Mierla authored on 27/07/2010 21:20:24
Showing 1 changed files
... ...
@@ -244,7 +244,9 @@ Options:\n\
244 244
     -g gid       Change gid \n\
245 245
     -P file      Create a pid file\n\
246 246
     -G file      Create a pgid file\n\
247
-    -O nr        Script optimization level (debugging option)\n"
247
+    -O nr        Script optimization level (debugging option)\n\
248
+    -a mode      Auto aliases mode: enable with yes or on,\n\
249
+                  disable with no or off\n"
248 250
 #ifdef STATS
249 251
 "    -s file     File to which statistics is dumped (disabled otherwise)\n"
250 252
 #endif
... ...
@@ -1665,7 +1667,7 @@ int main(int argc, char** argv)
1665 1665
 		"DBG_MSG_QA enabled, ser may exit abruptly\n");
1666 1666
 #endif
1667 1667
 
1668
-	options=  ":f:cm:dVhEb:l:L:n:vrRDTN:W:w:t:u:g:P:G:SQ:O:"
1668
+	options=  ":f:cm:dVhEb:l:L:n:vrRDTN:W:w:t:u:g:P:G:SQ:O:a:"
1669 1669
 #ifdef STATS
1670 1670
 		"s:"
1671 1671
 #endif
... ...
@@ -1764,6 +1766,7 @@ int main(int argc, char** argv)
1764 1764
 			case 'G':
1765 1765
 			case 'S':
1766 1766
 			case 'Q':
1767
+			case 'a':
1767 1768
 			case 's':
1768 1769
 					break;
1769 1770
 			case '?':
... ...
@@ -1977,6 +1980,18 @@ try_again:
1977 1977
 			case 'G':
1978 1978
 					pgid_file=optarg;
1979 1979
 					break;
1980
+			case 'a':
1981
+					if(strcmp(optarg, "on")==0 || strcmp(optarg, "yes")==0)
1982
+						sr_auto_aliases = 1;
1983
+					else if(strcmp(optarg, "off")==0 || strcmp(optarg, "no")==0)
1984
+						sr_auto_aliases = 0;
1985
+					else {
1986
+						fprintf(stderr,
1987
+							"bad auto aliases parameter: %s (valid on, off, yes, no)\n",
1988
+							optarg);
1989
+						goto error;
1990
+					}
1991
+					break;
1980 1992
 			case 's':
1981 1993
 				#ifdef STATS
1982 1994
 					stat_file=optarg;