|
@@ -11,10 +11,11 @@ char *HelloString = "Welcome To VirtualMath ("__TIME__", "__DATE__") \n"
|
|
|
static const struct option long_option[]={
|
|
|
{"log-err",required_argument,NULL,'o'},
|
|
|
{"log-out",required_argument,NULL,'e'},
|
|
|
+ {"not-run-cl",required_argument,NULL,'n'},
|
|
|
{NULL,0,NULL,0}
|
|
|
};
|
|
|
|
|
|
-static const char *short_option = "o:e:";
|
|
|
+static const char *short_option = "o:e:n";
|
|
|
|
|
|
/**
|
|
|
* 参数设置, args是全局结构体, 保存全局的参数设置
|
|
@@ -25,8 +26,9 @@ static const char *short_option = "o:e:";
|
|
|
int getArgs(const int argc, char **argv)
|
|
|
{
|
|
|
args.out_file = NULL;
|
|
|
- args.error_file = false;
|
|
|
- opterr = false;
|
|
|
+ args.error_file = NULL;
|
|
|
+ args.run_commandLine = true;
|
|
|
+ opterr = true;
|
|
|
int opt;
|
|
|
while((opt=getopt_long(argc, argv, short_option ,long_option,NULL))!=-1)
|
|
|
{
|
|
@@ -40,6 +42,9 @@ int getArgs(const int argc, char **argv)
|
|
|
case 'e':
|
|
|
args.error_file = memStrcpy(optarg);
|
|
|
break;
|
|
|
+ case 'n':
|
|
|
+ args.run_commandLine = false;
|
|
|
+ break;
|
|
|
case '?':
|
|
|
fprintf(stderr, "[Error]: get not success args : -%c\n", (char)optopt);
|
|
|
return -1;
|