示例#1
0
inline void
ORTEVerbositySetOptions(const char *options)
{
  debug_options(options);
}
示例#2
0
文件: main.c 项目: lundman/llink
void arguments(int argc, char **argv)
{
	int opt;

	while ((opt=getopt(argc, argv,
					   "hdv:f:w:xXsLp:V"
#ifdef WIN32
					   "IUN:P"
#endif
					   )) != -1) {

		switch(opt) {

		case 'h':
			options(argv[0]);
			break;

		case 'd':
			foreground = 1;
			break;

		case 'v':
			debug_on=atoi(optarg);
			if (!debug_on) debug_options();
			break;

		case 'f':
			SAFE_DUPE(conf_file, optarg);
			break;

		case 'w':
			chdir(optarg);
			break;

		case 'p':
			SAFE_DUPE(conf_pidfile, optarg);
			break;

		case 'x':
			conf_xmlscan = 1;
			printf("This needs to be implemented, use -X\n");
			break;

		case 'X':
			conf_xmlscan = 2;
			break;

		case 's':
			conf_fixup_syabas_subtitles = 1;
			break;

		case 'L':
			conf_fixup_nokeepalive = 0;
			break;

		case 'V':
			conf_fixup_childCount = 1;
			break;

#ifdef WIN32
		case 'I':
			// When started as service, we demand -P dir before the rest, which
			// includes the -I we have to ignore.
			if (!windows_service) {
				windows_service = 1;
				InstallService(argc,argv);
				_exit(0);
			}
			break;
		case 'N':
			SAFE_DUPE(g_pzServiceName, optarg);
			break;
		case 'U':
			UninstallService();
			exit(0);
			break;
		case 'P':
			windows_service = 1;
			break;
#endif

		default:
			printf("Unknown option. '%c'\n", opt);
			options(argv[0]);
			break;
		}
	}

	argc -= optind;
	argv += optind;

	// argc and argv adjusted here.



}