blob: ca4af9754cb07a22268992bee0a79f79ad313fc4 [file] [log] [blame]
[email protected]72e2e2422012-02-27 18:38:121// Copyright (c) 2012 The Chromium Authors. All rights reserved.
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commitd7cae122008-07-26 21:49:384
[email protected]f3adb5c2008-08-07 20:07:325#include "base/command_line.h"
6
initial.commitd7cae122008-07-26 21:49:387#include <algorithm>
[email protected]2edc2862011-04-04 18:04:378#include <ostream>
initial.commitd7cae122008-07-26 21:49:389
[email protected]2edc2862011-04-04 18:04:3710#include "base/basictypes.h"
[email protected]57999812013-02-24 05:40:5211#include "base/files/file_path.h"
initial.commitd7cae122008-07-26 21:49:3812#include "base/logging.h"
[email protected]5ae0b763e2013-02-07 23:01:3913#include "base/strings/string_split.h"
[email protected]251cd6e52013-06-11 13:36:3714#include "base/strings/string_util.h"
[email protected]a4ea1f12013-06-07 18:37:0715#include "base/strings/utf_string_conversions.h"
[email protected]74e9fa22010-12-29 21:06:4316#include "build/build_config.h"
initial.commitd7cae122008-07-26 21:49:3817
[email protected]74e9fa22010-12-29 21:06:4318#if defined(OS_WIN)
19#include <windows.h>
20#include <shellapi.h>
[email protected]7f113f32009-09-10 18:02:1721#endif
22
[email protected]2f3b1cc2014-03-17 23:07:1523namespace base {
[email protected]04af979a2013-02-16 04:12:2624
[email protected]bb975362009-01-21 01:00:2225CommandLine* CommandLine::current_process_commandline_ = NULL;
initial.commitd7cae122008-07-26 21:49:3826
[email protected]06cc083a2011-03-01 02:28:4227namespace {
[email protected]2f3b1cc2014-03-17 23:07:1528
[email protected]a40ca4302011-05-14 01:10:2429const CommandLine::CharType kSwitchTerminator[] = FILE_PATH_LITERAL("--");
30const CommandLine::CharType kSwitchValueSeparator[] = FILE_PATH_LITERAL("=");
[email protected]bf98a0e12013-09-25 23:36:0031
[email protected]06cc083a2011-03-01 02:28:4232// Since we use a lazy match, make sure that longer versions (like "--") are
33// listed before shorter versions (like "-") of similar prefixes.
[email protected]5d426332008-08-08 20:46:2134#if defined(OS_WIN)
[email protected]bf98a0e12013-09-25 23:36:0035// By putting slash last, we can control whether it is treaded as a switch
36// value by changing the value of switch_prefix_count to be one less than
37// the array size.
[email protected]a40ca4302011-05-14 01:10:2438const CommandLine::CharType* const kSwitchPrefixes[] = {L"--", L"-", L"/"};
[email protected]5d426332008-08-08 20:46:2139#elif defined(OS_POSIX)
[email protected]1a48f312008-08-12 01:14:3740// Unixes don't use slash as a switch.
[email protected]a40ca4302011-05-14 01:10:2441const CommandLine::CharType* const kSwitchPrefixes[] = {"--", "-"};
[email protected]5d426332008-08-08 20:46:2142#endif
[email protected]bf98a0e12013-09-25 23:36:0043size_t switch_prefix_count = arraysize(kSwitchPrefixes);
initial.commitd7cae122008-07-26 21:49:3844
[email protected]a40ca4302011-05-14 01:10:2445size_t GetSwitchPrefixLength(const CommandLine::StringType& string) {
[email protected]bf98a0e12013-09-25 23:36:0046 for (size_t i = 0; i < switch_prefix_count; ++i) {
[email protected]a40ca4302011-05-14 01:10:2447 CommandLine::StringType prefix(kSwitchPrefixes[i]);
[email protected]1fa39f02011-09-13 15:45:3448 if (string.compare(0, prefix.length(), prefix) == 0)
[email protected]a40ca4302011-05-14 01:10:2449 return prefix.length();
50 }
51 return 0;
initial.commitd7cae122008-07-26 21:49:3852}
[email protected]0fd23af2011-02-20 06:33:0453
[email protected]a40ca4302011-05-14 01:10:2454// Fills in |switch_string| and |switch_value| if |string| is a switch.
55// This will preserve the input switch prefix in the output |switch_string|.
56bool IsSwitch(const CommandLine::StringType& string,
57 CommandLine::StringType* switch_string,
58 CommandLine::StringType* switch_value) {
59 switch_string->clear();
60 switch_value->clear();
[email protected]21e342f2012-10-19 06:19:5961 size_t prefix_length = GetSwitchPrefixLength(string);
62 if (prefix_length == 0 || prefix_length == string.length())
[email protected]a40ca4302011-05-14 01:10:2463 return false;
64
65 const size_t equals_position = string.find(kSwitchValueSeparator);
66 *switch_string = string.substr(0, equals_position);
67 if (equals_position != CommandLine::StringType::npos)
68 *switch_value = string.substr(equals_position + 1);
69 return true;
70}
71
72// Append switches and arguments, keeping switches before arguments.
73void AppendSwitchesAndArguments(CommandLine& command_line,
74 const CommandLine::StringVector& argv) {
75 bool parse_switches = true;
76 for (size_t i = 1; i < argv.size(); ++i) {
77 CommandLine::StringType arg = argv[i];
[email protected]2f3b1cc2014-03-17 23:07:1578 TrimWhitespace(arg, TRIM_ALL, &arg);
[email protected]a40ca4302011-05-14 01:10:2479
80 CommandLine::StringType switch_string;
81 CommandLine::StringType switch_value;
82 parse_switches &= (arg != kSwitchTerminator);
83 if (parse_switches && IsSwitch(arg, &switch_string, &switch_value)) {
84#if defined(OS_WIN)
[email protected]2f3b1cc2014-03-17 23:07:1585 command_line.AppendSwitchNative(UTF16ToASCII(switch_string),
[email protected]74f778e2014-03-14 21:11:4686 switch_value);
[email protected]a40ca4302011-05-14 01:10:2487#elif defined(OS_POSIX)
88 command_line.AppendSwitchNative(switch_string, switch_value);
89#endif
90 } else {
91 command_line.AppendArgNative(arg);
92 }
93 }
94}
95
96// Lowercase switches for backwards compatiblity *on Windows*.
97std::string LowerASCIIOnWindows(const std::string& string) {
98#if defined(OS_WIN)
[email protected]cb1f4ac2014-08-07 16:55:4299 return base::StringToLowerASCII(string);
[email protected]a40ca4302011-05-14 01:10:24100#elif defined(OS_POSIX)
101 return string;
102#endif
103}
104
105
106#if defined(OS_WIN)
107// Quote a string as necessary for CommandLineToArgvW compatiblity *on Windows*.
108std::wstring QuoteForCommandLineToArgvW(const std::wstring& arg) {
[email protected]0fd23af2011-02-20 06:33:04109 // We follow the quoting rules of CommandLineToArgvW.
110 // http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
111 if (arg.find_first_of(L" \\\"") == std::wstring::npos) {
112 // No quoting necessary.
113 return arg;
114 }
115
116 std::wstring out;
117 out.push_back(L'"');
118 for (size_t i = 0; i < arg.size(); ++i) {
119 if (arg[i] == '\\') {
120 // Find the extent of this run of backslashes.
121 size_t start = i, end = start + 1;
122 for (; end < arg.size() && arg[end] == '\\'; ++end)
123 /* empty */;
124 size_t backslash_count = end - start;
125
126 // Backslashes are escapes only if the run is followed by a double quote.
127 // Since we also will end the string with a double quote, we escape for
128 // either a double quote or the end of the string.
129 if (end == arg.size() || arg[end] == '"') {
130 // To quote, we need to output 2x as many backslashes.
131 backslash_count *= 2;
132 }
133 for (size_t j = 0; j < backslash_count; ++j)
134 out.push_back('\\');
135
136 // Advance i to one before the end to balance i++ in loop.
137 i = end - 1;
138 } else if (arg[i] == '"') {
139 out.push_back('\\');
140 out.push_back('"');
141 } else {
142 out.push_back(arg[i]);
143 }
144 }
145 out.push_back('"');
146
147 return out;
148}
[email protected]bb975362009-01-21 01:00:22149#endif
initial.commitd7cae122008-07-26 21:49:38150
[email protected]06cc083a2011-03-01 02:28:42151} // namespace
152
[email protected]a40ca4302011-05-14 01:10:24153CommandLine::CommandLine(NoProgram no_program)
154 : argv_(1),
155 begin_args_(1) {
[email protected]06cc083a2011-03-01 02:28:42156}
157
[email protected]a40ca4302011-05-14 01:10:24158CommandLine::CommandLine(const FilePath& program)
159 : argv_(1),
160 begin_args_(1) {
161 SetProgram(program);
[email protected]06cc083a2011-03-01 02:28:42162}
163
[email protected]a40ca4302011-05-14 01:10:24164CommandLine::CommandLine(int argc, const CommandLine::CharType* const* argv)
165 : argv_(1),
166 begin_args_(1) {
[email protected]06cc083a2011-03-01 02:28:42167 InitFromArgv(argc, argv);
168}
169
[email protected]a40ca4302011-05-14 01:10:24170CommandLine::CommandLine(const StringVector& argv)
171 : argv_(1),
172 begin_args_(1) {
[email protected]06cc083a2011-03-01 02:28:42173 InitFromArgv(argv);
174}
[email protected]06cc083a2011-03-01 02:28:42175
[email protected]acbeb3d2011-03-01 20:47:58176CommandLine::~CommandLine() {
177}
178
[email protected]bf98a0e12013-09-25 23:36:00179#if defined(OS_WIN)
180// static
181void CommandLine::set_slash_is_not_a_switch() {
182 // The last switch prefix should be slash, so adjust the size to skip it.
183 DCHECK(wcscmp(kSwitchPrefixes[arraysize(kSwitchPrefixes) - 1], L"/") == 0);
184 switch_prefix_count = arraysize(kSwitchPrefixes) - 1;
185}
186#endif
187
[email protected]06cc083a2011-03-01 02:28:42188// static
[email protected]72e2e2422012-02-27 18:38:12189bool CommandLine::Init(int argc, const char* const* argv) {
[email protected]f96fe2c42011-07-13 18:03:34190 if (current_process_commandline_) {
191 // If this is intentional, Reset() must be called first. If we are using
192 // the shared build mode, we have to share a single object across multiple
193 // shared libraries.
[email protected]72e2e2422012-02-27 18:38:12194 return false;
[email protected]f96fe2c42011-07-13 18:03:34195 }
196
[email protected]a40ca4302011-05-14 01:10:24197 current_process_commandline_ = new CommandLine(NO_PROGRAM);
[email protected]06cc083a2011-03-01 02:28:42198#if defined(OS_WIN)
199 current_process_commandline_->ParseFromString(::GetCommandLineW());
200#elif defined(OS_POSIX)
201 current_process_commandline_->InitFromArgv(argc, argv);
202#endif
[email protected]72e2e2422012-02-27 18:38:12203
204 return true;
[email protected]06cc083a2011-03-01 02:28:42205}
206
207// static
208void CommandLine::Reset() {
209 DCHECK(current_process_commandline_);
210 delete current_process_commandline_;
211 current_process_commandline_ = NULL;
212}
213
214// static
215CommandLine* CommandLine::ForCurrentProcess() {
216 DCHECK(current_process_commandline_);
217 return current_process_commandline_;
[email protected]3a3d47472010-07-15 21:03:54218}
219
[email protected]2bf64a92013-07-11 23:10:40220// static
221bool CommandLine::InitializedForCurrentProcess() {
222 return !!current_process_commandline_;
223}
224
[email protected]f3adb5c2008-08-07 20:07:32225#if defined(OS_WIN)
[email protected]06cc083a2011-03-01 02:28:42226// static
227CommandLine CommandLine::FromString(const std::wstring& command_line) {
[email protected]a40ca4302011-05-14 01:10:24228 CommandLine cmd(NO_PROGRAM);
[email protected]06cc083a2011-03-01 02:28:42229 cmd.ParseFromString(command_line);
230 return cmd;
231}
[email protected]a40ca4302011-05-14 01:10:24232#endif
[email protected]06cc083a2011-03-01 02:28:42233
[email protected]a40ca4302011-05-14 01:10:24234void CommandLine::InitFromArgv(int argc,
235 const CommandLine::CharType* const* argv) {
236 StringVector new_argv;
[email protected]06cc083a2011-03-01 02:28:42237 for (int i = 0; i < argc; ++i)
[email protected]a40ca4302011-05-14 01:10:24238 new_argv.push_back(argv[i]);
239 InitFromArgv(new_argv);
[email protected]51343d5a2009-10-26 22:39:33240}
241
[email protected]06cc083a2011-03-01 02:28:42242void CommandLine::InitFromArgv(const StringVector& argv) {
[email protected]a40ca4302011-05-14 01:10:24243 argv_ = StringVector(1);
[email protected]93660ab32013-06-18 08:19:18244 switches_.clear();
[email protected]a40ca4302011-05-14 01:10:24245 begin_args_ = 1;
246 SetProgram(argv.empty() ? FilePath() : FilePath(argv[0]));
247 AppendSwitchesAndArguments(*this, argv);
[email protected]06cc083a2011-03-01 02:28:42248}
[email protected]06cc083a2011-03-01 02:28:42249
[email protected]61a4c6f2011-07-20 04:54:52250CommandLine::StringType CommandLine::GetCommandLineString() const {
[email protected]a40ca4302011-05-14 01:10:24251 StringType string(argv_[0]);
[email protected]06cc083a2011-03-01 02:28:42252#if defined(OS_WIN)
[email protected]a40ca4302011-05-14 01:10:24253 string = QuoteForCommandLineToArgvW(string);
[email protected]06cc083a2011-03-01 02:28:42254#endif
[email protected]45f982e2012-10-29 21:31:31255 StringType params(GetArgumentsString());
256 if (!params.empty()) {
257 string.append(StringType(FILE_PATH_LITERAL(" ")));
258 string.append(params);
259 }
260 return string;
261}
262
263CommandLine::StringType CommandLine::GetArgumentsString() const {
264 StringType params;
[email protected]a40ca4302011-05-14 01:10:24265 // Append switches and arguments.
266 bool parse_switches = true;
267 for (size_t i = 1; i < argv_.size(); ++i) {
[email protected]45f982e2012-10-29 21:31:31268 StringType arg = argv_[i];
269 StringType switch_string;
270 StringType switch_value;
[email protected]a40ca4302011-05-14 01:10:24271 parse_switches &= arg != kSwitchTerminator;
[email protected]45f982e2012-10-29 21:31:31272 if (i > 1)
273 params.append(StringType(FILE_PATH_LITERAL(" ")));
[email protected]a40ca4302011-05-14 01:10:24274 if (parse_switches && IsSwitch(arg, &switch_string, &switch_value)) {
[email protected]45f982e2012-10-29 21:31:31275 params.append(switch_string);
[email protected]a40ca4302011-05-14 01:10:24276 if (!switch_value.empty()) {
277#if defined(OS_WIN)
278 switch_value = QuoteForCommandLineToArgvW(switch_value);
279#endif
[email protected]45f982e2012-10-29 21:31:31280 params.append(kSwitchValueSeparator + switch_value);
[email protected]a40ca4302011-05-14 01:10:24281 }
282 }
283 else {
284#if defined(OS_WIN)
285 arg = QuoteForCommandLineToArgvW(arg);
286#endif
[email protected]45f982e2012-10-29 21:31:31287 params.append(arg);
[email protected]a40ca4302011-05-14 01:10:24288 }
289 }
[email protected]45f982e2012-10-29 21:31:31290 return params;
[email protected]06cc083a2011-03-01 02:28:42291}
292
293FilePath CommandLine::GetProgram() const {
[email protected]06cc083a2011-03-01 02:28:42294 return FilePath(argv_[0]);
[email protected]a40ca4302011-05-14 01:10:24295}
296
297void CommandLine::SetProgram(const FilePath& program) {
[email protected]2f3b1cc2014-03-17 23:07:15298 TrimWhitespace(program.value(), TRIM_ALL, &argv_[0]);
[email protected]06cc083a2011-03-01 02:28:42299}
300
301bool CommandLine::HasSwitch(const std::string& switch_string) const {
[email protected]a40ca4302011-05-14 01:10:24302 return switches_.find(LowerASCIIOnWindows(switch_string)) != switches_.end();
[email protected]06cc083a2011-03-01 02:28:42303}
304
305std::string CommandLine::GetSwitchValueASCII(
306 const std::string& switch_string) const {
[email protected]a40ca4302011-05-14 01:10:24307 StringType value = GetSwitchValueNative(switch_string);
[email protected]bd6fc2f2014-03-17 23:55:43308 if (!IsStringASCII(value)) {
[email protected]a42d4632011-10-26 21:48:00309 DLOG(WARNING) << "Value of switch (" << switch_string << ") must be ASCII.";
310 return std::string();
[email protected]06cc083a2011-03-01 02:28:42311 }
312#if defined(OS_WIN)
[email protected]2f3b1cc2014-03-17 23:07:15313 return UTF16ToASCII(value);
[email protected]06cc083a2011-03-01 02:28:42314#else
315 return value;
316#endif
317}
318
319FilePath CommandLine::GetSwitchValuePath(
320 const std::string& switch_string) const {
321 return FilePath(GetSwitchValueNative(switch_string));
322}
323
324CommandLine::StringType CommandLine::GetSwitchValueNative(
325 const std::string& switch_string) const {
[email protected]9098e352013-11-21 12:05:28326 SwitchMap::const_iterator result =
327 switches_.find(LowerASCIIOnWindows(switch_string));
[email protected]a40ca4302011-05-14 01:10:24328 return result == switches_.end() ? StringType() : result->second;
[email protected]06cc083a2011-03-01 02:28:42329}
330
[email protected]06cc083a2011-03-01 02:28:42331void CommandLine::AppendSwitch(const std::string& switch_string) {
[email protected]a40ca4302011-05-14 01:10:24332 AppendSwitchNative(switch_string, StringType());
[email protected]06cc083a2011-03-01 02:28:42333}
334
335void CommandLine::AppendSwitchPath(const std::string& switch_string,
336 const FilePath& path) {
337 AppendSwitchNative(switch_string, path.value());
338}
339
340void CommandLine::AppendSwitchNative(const std::string& switch_string,
341 const CommandLine::StringType& value) {
[email protected]a40ca4302011-05-14 01:10:24342 std::string switch_key(LowerASCIIOnWindows(switch_string));
[email protected]06cc083a2011-03-01 02:28:42343#if defined(OS_WIN)
[email protected]2f3b1cc2014-03-17 23:07:15344 StringType combined_switch_string(ASCIIToWide(switch_key));
[email protected]06cc083a2011-03-01 02:28:42345#elif defined(OS_POSIX)
[email protected]a40ca4302011-05-14 01:10:24346 StringType combined_switch_string(switch_string);
347#endif
348 size_t prefix_length = GetSwitchPrefixLength(combined_switch_string);
349 switches_[switch_key.substr(prefix_length)] = value;
350 // Preserve existing switch prefixes in |argv_|; only append one if necessary.
351 if (prefix_length == 0)
352 combined_switch_string = kSwitchPrefixes[0] + combined_switch_string;
[email protected]06cc083a2011-03-01 02:28:42353 if (!value.empty())
354 combined_switch_string += kSwitchValueSeparator + value;
[email protected]a40ca4302011-05-14 01:10:24355 // Append the switch and update the switches/arguments divider |begin_args_|.
356 argv_.insert(argv_.begin() + begin_args_++, combined_switch_string);
[email protected]06cc083a2011-03-01 02:28:42357}
358
359void CommandLine::AppendSwitchASCII(const std::string& switch_string,
360 const std::string& value_string) {
361#if defined(OS_WIN)
[email protected]2f3b1cc2014-03-17 23:07:15362 AppendSwitchNative(switch_string, ASCIIToWide(value_string));
[email protected]06cc083a2011-03-01 02:28:42363#elif defined(OS_POSIX)
364 AppendSwitchNative(switch_string, value_string);
365#endif
366}
367
[email protected]06cc083a2011-03-01 02:28:42368void CommandLine::CopySwitchesFrom(const CommandLine& source,
369 const char* const switches[],
370 size_t count) {
371 for (size_t i = 0; i < count; ++i) {
[email protected]a40ca4302011-05-14 01:10:24372 if (source.HasSwitch(switches[i]))
373 AppendSwitchNative(switches[i], source.GetSwitchValueNative(switches[i]));
[email protected]06cc083a2011-03-01 02:28:42374 }
375}
376
[email protected]75f1c782011-07-13 23:41:22377CommandLine::StringVector CommandLine::GetArgs() const {
[email protected]a40ca4302011-05-14 01:10:24378 // Gather all arguments after the last switch (may include kSwitchTerminator).
379 StringVector args(argv_.begin() + begin_args_, argv_.end());
380 // Erase only the first kSwitchTerminator (maybe "--" is a legitimate page?)
381 StringVector::iterator switch_terminator =
382 std::find(args.begin(), args.end(), kSwitchTerminator);
383 if (switch_terminator != args.end())
384 args.erase(switch_terminator);
385 return args;
386}
387
[email protected]06cc083a2011-03-01 02:28:42388void CommandLine::AppendArg(const std::string& value) {
389#if defined(OS_WIN)
[email protected]bd6fc2f2014-03-17 23:55:43390 DCHECK(IsStringUTF8(value));
391 AppendArgNative(UTF8ToWide(value));
[email protected]06cc083a2011-03-01 02:28:42392#elif defined(OS_POSIX)
393 AppendArgNative(value);
394#endif
395}
396
397void CommandLine::AppendArgPath(const FilePath& path) {
398 AppendArgNative(path.value());
399}
400
401void CommandLine::AppendArgNative(const CommandLine::StringType& value) {
[email protected]06cc083a2011-03-01 02:28:42402 argv_.push_back(value);
[email protected]06cc083a2011-03-01 02:28:42403}
404
405void CommandLine::AppendArguments(const CommandLine& other,
406 bool include_program) {
[email protected]06cc083a2011-03-01 02:28:42407 if (include_program)
[email protected]a40ca4302011-05-14 01:10:24408 SetProgram(other.GetProgram());
409 AppendSwitchesAndArguments(*this, other.argv());
[email protected]06cc083a2011-03-01 02:28:42410}
411
412void CommandLine::PrependWrapper(const CommandLine::StringType& wrapper) {
[email protected]06cc083a2011-03-01 02:28:42413 if (wrapper.empty())
414 return;
[email protected]a40ca4302011-05-14 01:10:24415 // The wrapper may have embedded arguments (like "gdb --args"). In this case,
416 // we don't pretend to do anything fancy, we just split on spaces.
417 StringVector wrapper_argv;
[email protected]2f3b1cc2014-03-17 23:07:15418 SplitString(wrapper, FILE_PATH_LITERAL(' '), &wrapper_argv);
[email protected]a40ca4302011-05-14 01:10:24419 // Prepend the wrapper and update the switches/arguments |begin_args_|.
420 argv_.insert(argv_.begin(), wrapper_argv.begin(), wrapper_argv.end());
421 begin_args_ += wrapper_argv.size();
[email protected]06cc083a2011-03-01 02:28:42422}
423
424#if defined(OS_WIN)
[email protected]bb975362009-01-21 01:00:22425void CommandLine::ParseFromString(const std::wstring& command_line) {
[email protected]a40ca4302011-05-14 01:10:24426 std::wstring command_line_string;
[email protected]2f3b1cc2014-03-17 23:07:15427 TrimWhitespace(command_line, TRIM_ALL, &command_line_string);
[email protected]a40ca4302011-05-14 01:10:24428 if (command_line_string.empty())
[email protected]bb975362009-01-21 01:00:22429 return;
430
431 int num_args = 0;
432 wchar_t** args = NULL;
[email protected]a40ca4302011-05-14 01:10:24433 args = ::CommandLineToArgvW(command_line_string.c_str(), &num_args);
[email protected]bb975362009-01-21 01:00:22434
[email protected]a42d4632011-10-26 21:48:00435 DPLOG_IF(FATAL, !args) << "CommandLineToArgvW failed on command line: "
[email protected]2f3b1cc2014-03-17 23:07:15436 << UTF16ToUTF8(command_line);
[email protected]a40ca4302011-05-14 01:10:24437 InitFromArgv(num_args, args);
438 LocalFree(args);
[email protected]bb975362009-01-21 01:00:22439}
[email protected]f3adb5c2008-08-07 20:07:32440#endif
[email protected]2f3b1cc2014-03-17 23:07:15441
442} // namespace base