@@ -47,48 +47,46 @@ const char *non_ms_cl_options[]=
47
47
nullptr
48
48
};
49
49
50
- bool ms_cl_cmdlinet::parse (const std::vector<std::string> &options )
50
+ bool ms_cl_cmdlinet::parse (const std::vector<std::string> &arguments )
51
51
{
52
- for (std::size_t i= 0 ; i<options .size (); i++)
52
+ for (std::size_t i = 0 ; i < arguments .size (); i++)
53
53
{
54
54
// is it a non-cl option?
55
- if (std::string (options [i], 0 , 2 )== " --" )
55
+ if (std::string (arguments [i], 0 , 2 ) == " --" )
56
56
{
57
- process_non_cl_option (options [i]);
57
+ process_non_cl_option (arguments [i]);
58
58
59
- if (options[i]==" --verbosity" ||
60
- options[i]==" --function" )
59
+ if (arguments[i] == " --verbosity" || arguments[i] == " --function" )
61
60
{
62
- if (i<options .size ()- 1 )
61
+ if (i < arguments .size () - 1 )
63
62
{
64
- set (options [i], options[i+ 1 ]);
63
+ set (arguments [i], arguments[i + 1 ]);
65
64
i++; // skip ahead
66
65
}
67
66
}
68
67
}
69
- else if (!options [i].empty () && options [i][0 ]== ' @' )
68
+ else if (!arguments [i].empty () && arguments [i][0 ] == ' @' )
70
69
{
71
70
// potentially recursive
72
- process_response_file (
73
- std::string (options[i], 1 , std::string::npos));
71
+ process_response_file (std::string (arguments[i], 1 , std::string::npos));
74
72
}
75
- else if (options[i]==" /link" ||
76
- options[i]==" -link" )
73
+ else if (arguments[i] == " /link" || arguments[i] == " -link" )
77
74
{
78
75
// anything that follows goes to the linker
79
- i=options .size ()- 1 ;
76
+ i = arguments .size () - 1 ;
80
77
}
81
- else if (options[i].size ()==2 &&
82
- (options[i]==" /D" || options[i]==" -D" ) &&
83
- i!=options.size ()-1 )
78
+ else if (
79
+ arguments[i].size () == 2 &&
80
+ (arguments[i] == " /D" || arguments[i] == " -D" ) &&
81
+ i != arguments.size () - 1 )
84
82
{
85
83
// this requires special treatment, as you can do "/D something"
86
- std::string tmp= " /D" +options[i+ 1 ];
84
+ std::string tmp = " /D" + arguments[i + 1 ];
87
85
i++;
88
86
process_cl_option (tmp);
89
87
}
90
88
else
91
- process_cl_option (options [i]);
89
+ process_cl_option (arguments [i]);
92
90
}
93
91
94
92
return false ;
@@ -123,13 +121,13 @@ bool ms_cl_cmdlinet::parse(int argc, const char **argv)
123
121
{
124
122
// should really use "wide" argv from wmain()
125
123
126
- std::vector<std::string> options ;
124
+ std::vector<std::string> arguments ;
127
125
128
126
// skip argv[0]
129
127
for (int i=1 ; i<argc; i++)
130
- options .push_back (argv[i]);
128
+ arguments .push_back (argv[i]);
131
129
132
- return parse (options );
130
+ return parse (arguments );
133
131
}
134
132
135
133
static std::istream &my_wgetline (std::istream &in, std::wstring &dest)
@@ -242,7 +240,7 @@ void ms_cl_cmdlinet::process_response_file_line(const std::string &line)
242
240
if (line[0 ]==' #' )
243
241
return ; // comment
244
242
245
- std::vector<std::string> options ;
243
+ std::vector<std::string> arguments ;
246
244
std::string option;
247
245
bool in_quotes=false ;
248
246
for (std::size_t i=0 ; i<line.size (); i++)
@@ -252,7 +250,7 @@ void ms_cl_cmdlinet::process_response_file_line(const std::string &line)
252
250
if (ch==' ' && !in_quotes)
253
251
{
254
252
if (!option.empty ())
255
- options .push_back (option);
253
+ arguments .push_back (option);
256
254
option.clear ();
257
255
}
258
256
else if (ch==' "' )
@@ -264,9 +262,9 @@ void ms_cl_cmdlinet::process_response_file_line(const std::string &line)
264
262
}
265
263
266
264
if (!option.empty ())
267
- options .push_back (option);
265
+ arguments .push_back (option);
268
266
269
- parse (options );
267
+ parse (arguments );
270
268
}
271
269
272
270
// / \return none
0 commit comments