[go: nahoru, domu]

blob: bb63ea5bb7125264aa3919206ecb801c454da13e [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2012 The Chromium Authors
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.
deanm@chromium.org02c87962008-10-06 10:25:354
evan@chromium.orgbb975362009-01-21 01:00:225// This class works with command lines: building and parsing.
msw@chromium.orga40ca4302011-05-14 01:10:246// Arguments with prefixes ('--', '-', and on Windows, '/') are switches.
7// Switches will precede all other arguments without switch prefixes.
8// Switches can optionally have values, delimited by '=', e.g., "-switch=value".
John Rummellb1d5fcb2019-04-27 01:13:339// If a switch is specified multiple times, only the last value is used.
msw@chromium.orga40ca4302011-05-14 01:10:2410// An argument of "--" will terminate switch parsing during initialization,
11// interpreting subsequent tokens as non-switch arguments, regardless of prefix.
evan@chromium.orgbb975362009-01-21 01:00:2212
msw@chromium.org06cc083a2011-03-01 02:28:4213// There is a singleton read-only CommandLine that represents the command line
14// that the current process was started with. It must be initialized in main().
initial.commitd7cae122008-07-26 21:49:3815
deanm@chromium.org02c87962008-10-06 10:25:3516#ifndef BASE_COMMAND_LINE_H_
17#define BASE_COMMAND_LINE_H_
initial.commitd7cae122008-07-26 21:49:3818
jhawkins@chromium.org2edc2862011-04-04 18:04:3719#include <stddef.h>
Sumaid Syed22f60eeb2021-08-26 05:16:2620#include <functional>
initial.commitd7cae122008-07-26 21:49:3821#include <map>
Stephan Hartmann41859782021-10-12 18:49:2322#include <memory>
initial.commitd7cae122008-07-26 21:49:3823#include <string>
Takuto Ikuta9dcb26dd2023-12-19 08:02:0824#include <string_view>
initial.commitd7cae122008-07-26 21:49:3825#include <vector>
26
darin@chromium.org0bea7252011-08-05 15:34:0027#include "base/base_export.h"
Lei Zhang24dcd3e2023-07-07 20:08:3628#include "base/containers/span.h"
Will Harrisee9f0a22023-03-02 21:38:5829#include "base/debug/debugging_buildflags.h"
jackhou1bd9da92015-05-21 04:48:0030#include "base/strings/string_piece.h"
brettw@chromium.org74e9fa22010-12-29 21:06:4331#include "build/build_config.h"
initial.commitd7cae122008-07-26 21:49:3832
Will Harrisee9f0a22023-03-02 21:38:5833#if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS)
34#include "base/sequence_checker.h"
35#endif // BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS)
36
brettw@chromium.orga3ef4832013-02-02 05:12:3337namespace base {
brettw@chromium.org2f3b1cc2014-03-17 23:07:1538
Greg Gutermanfe16560d2021-10-07 19:58:1539class DuplicateSwitchHandler;
Greg Gutermane6051192021-10-15 21:14:3640class FilePath;
sky@google.comd4515eb2009-01-30 00:40:4341
darin@chromium.org0bea7252011-08-05 15:34:0042class BASE_EXPORT CommandLine {
initial.commitd7cae122008-07-26 21:49:3843 public:
Xiaohan Wang38e4ebb2022-01-19 06:57:4344#if BUILDFLAG(IS_WIN)
msw@chromium.org06cc083a2011-03-01 02:28:4245 // The native command line string type.
Jan Wilken Dörrieda77fd432019-10-24 21:40:3446 using StringType = std::wstring;
Xiaohan Wang38e4ebb2022-01-19 06:57:4347#elif BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
thestigfd085682016-07-15 02:50:1648 using StringType = std::string;
erg@google.coma502bbe72011-01-07 18:06:4549#endif
50
thestigfd085682016-07-15 02:50:1651 using CharType = StringType::value_type;
Takuto Ikuta9dcb26dd2023-12-19 08:02:0852 using StringPieceType = std::basic_string_view<CharType>;
thestigfd085682016-07-15 02:50:1653 using StringVector = std::vector<StringType>;
Jeremy Roman863386d2017-10-31 19:25:3854 using SwitchMap = std::map<std::string, StringType, std::less<>>;
erg@google.coma502bbe72011-01-07 18:06:4555
mayuko aibafa08692f2024-01-12 03:58:3856 // Returns CommandLine object constructed with switches and keys alone.
57 // NOTE: `argv` must NOT include the program path, and the switch arguments
58 // must start from the index 0.
59 static CommandLine FromArgvWithoutProgram(const StringVector& argv);
60
61#if BUILDFLAG(IS_WIN)
62 static CommandLine FromString(StringPieceType command_line);
63#endif
64
msw@chromium.org06cc083a2011-03-01 02:28:4265 // A constructor for CommandLines that only carry switches and arguments.
mattm@chromium.org947446b2010-10-21 03:36:3166 enum NoProgram { NO_PROGRAM };
67 explicit CommandLine(NoProgram no_program);
erg@google.coma502bbe72011-01-07 18:06:4568
msw@chromium.org06cc083a2011-03-01 02:28:4269 // Construct a new command line with |program| as argv[0].
brettw@chromium.org2f3b1cc2014-03-17 23:07:1570 explicit CommandLine(const FilePath& program);
erg@google.coma502bbe72011-01-07 18:06:4571
msw@chromium.orga40ca4302011-05-14 01:10:2472 // Construct a new command line from an argument list.
73 CommandLine(int argc, const CharType* const* argv);
msw@chromium.org06cc083a2011-03-01 02:28:4274 explicit CommandLine(const StringVector& argv);
erg@google.coma502bbe72011-01-07 18:06:4575
Will Harrisee9f0a22023-03-02 21:38:5876 // Allow the copy constructor. A common pattern is to copy of the current
77 // process's command line and then add some flags to it. For example:
78 // CommandLine cl(*CommandLine::ForCurrentProcess());
79 // cl.AppendSwitch(...);
jackhou1bd9da92015-05-21 04:48:0080 CommandLine(const CommandLine& other);
81 CommandLine& operator=(const CommandLine& other);
82
msw@chromium.orgacbeb3d2011-03-01 20:47:5883 ~CommandLine();
84
Xiaohan Wang38e4ebb2022-01-19 06:57:4385#if BUILDFLAG(IS_WIN)
brettw@chromium.orgbf98a0e12013-09-25 23:36:0086 // By default this class will treat command-line arguments beginning with
87 // slashes as switches on Windows, but not other platforms.
88 //
89 // If this behavior is inappropriate for your application, you can call this
90 // function BEFORE initializing the current process' global command line
91 // object and the behavior will be the same as Posix systems (only hyphens
92 // begin switches, everything else will be an arg).
93 static void set_slash_is_not_a_switch();
anantad936bc12016-06-22 21:40:3194
95 // Normally when the CommandLine singleton is initialized it gets the command
96 // line via the GetCommandLineW API and then uses the shell32 API
97 // CommandLineToArgvW to parse the command line and convert it back to
98 // argc and argv. Tests who don't want this dependency on shell32 and need
99 // to honor the arguments passed in should use this function.
100 static void InitUsingArgvForTesting(int argc, const char* const* argv);
brettw@chromium.orgbf98a0e12013-09-25 23:36:00101#endif
102
msw@chromium.org06cc083a2011-03-01 02:28:42103 // Initialize the current process CommandLine singleton. On Windows, ignores
104 // its arguments (we instead parse GetCommandLineW() directly) because we
105 // don't trust the CRT's parsing of the command line, but it still must be
erikwright@chromium.org72e2e2422012-02-27 18:38:12106 // called to set up the command line. Returns false if initialization has
107 // already occurred, and true otherwise. Only the caller receiving a 'true'
108 // return value should take responsibility for calling Reset.
109 static bool Init(int argc, const char* const* argv);
evan@chromium.orgbb975362009-01-21 01:00:22110
evan@chromium.orga2318cda2009-02-25 21:13:53111 // Destroys the current process CommandLine singleton. This is necessary if
msw@chromium.org06cc083a2011-03-01 02:28:42112 // you want to reset the base library to its initial state (for example, in an
evan@chromium.orga2318cda2009-02-25 21:13:53113 // outer library that needs to be able to terminate, and be re-initialized).
msw@chromium.org06cc083a2011-03-01 02:28:42114 // If Init is called only once, as in main(), Reset() is not necessary.
thestigfd085682016-07-15 02:50:16115 // Do not call this in tests. Use base::test::ScopedCommandLine instead.
evan@chromium.org02fb75ab2009-10-12 16:11:40116 static void Reset();
evan@chromium.orga2318cda2009-02-25 21:13:53117
evan@chromium.orgbb975362009-01-21 01:00:22118 // Get the singleton CommandLine representing the current process's
msw@chromium.org06cc083a2011-03-01 02:28:42119 // command line. Note: returned value is mutable, but not thread safe;
evan@chromium.org0189bbd2009-10-12 22:50:39120 // only mutate if you know what you're doing!
erg@google.comdcd869c2010-08-30 20:15:25121 static CommandLine* ForCurrentProcess();
evanm@google.com1a48f312008-08-12 01:14:37122
vollick@chromium.org2bf64a92013-07-11 23:10:40123 // Returns true if the CommandLine has been initialized for the given process.
124 static bool InitializedForCurrentProcess();
125
msw@chromium.org06cc083a2011-03-01 02:28:42126 // Initialize from an argv vector.
msw@chromium.orga40ca4302011-05-14 01:10:24127 void InitFromArgv(int argc, const CharType* const* argv);
msw@chromium.org06cc083a2011-03-01 02:28:42128 void InitFromArgv(const StringVector& argv);
msw@chromium.org06cc083a2011-03-01 02:28:42129
msw@chromium.orga40ca4302011-05-14 01:10:24130 // Constructs and returns the represented command line string.
gab@chromium.org45f982e2012-10-29 21:31:31131 // CAUTION! This should be avoided on POSIX because quoting behavior is
132 // unclear.
Jesse McKenna036150c2020-07-17 21:11:17133 // CAUTION! If writing a command line to the Windows registry, use
134 // GetCommandLineStringForShell() instead.
135 StringType GetCommandLineString() const;
mgiucac974d512014-10-01 09:24:51136
Xiaohan Wang38e4ebb2022-01-19 06:57:43137#if BUILDFLAG(IS_WIN)
S. Ganeshf2c7cb732022-12-16 22:54:42138 // Quotes and escapes `arg` if necessary so that it will be interpreted as a
139 // single command-line parameter according to the following rules in line with
140 // `::CommandLineToArgvW` and C++ `main`:
141 // * Returns `arg` unchanged if `arg` does not include any characters that may
142 // need encoding, which is spaces, tabs, backslashes, and double-quotes.
143 // * Otherwise, double-quotes `arg` and in addition:
144 // * Escapes any double-quotes in `arg` with backslashes.
145 // * Escapes backslashes in `arg` if:
146 // * `arg` ends with backslashes , or
147 // * the backslashes end in a pre-existing double quote.
148 //
149 // https://learn.microsoft.com/en-us/search/?terms=CommandLineToArgvW and
150 // http://msdn.microsoft.com/en-us/library/17w5ykft.aspx#parsing-c-command-line-arguments.
151 static std::wstring QuoteForCommandLineToArgvW(const std::wstring& arg);
152
Jesse McKenna036150c2020-07-17 21:11:17153 // Returns the command-line string in the proper format for the Windows shell,
154 // ending with the argument placeholder "--single-argument %1". The single-
155 // argument switch prevents unexpected parsing of arguments from other
156 // software that cannot be trusted to escape double quotes when substituting
Jesse McKenna185ceda22021-03-10 06:47:55157 // into a placeholder (e.g., "%1" insert sequences populated by the Windows
Jesse McKenna036150c2020-07-17 21:11:17158 // shell).
159 // NOTE: this must be used to generate the command-line string for the shell
160 // even if this command line was parsed from a string with the proper syntax,
161 // because the --single-argument switch is not preserved during parsing.
162 StringType GetCommandLineStringForShell() const;
Jesse McKenna185ceda22021-03-10 06:47:55163
164 // Returns the represented command-line string. Allows the use of unsafe
165 // Windows insert sequences like "%1". Only use this method if
166 // GetCommandLineStringForShell() is not adequate AND the processor inserting
167 // the arguments is known to do so securely (i.e., is not the Windows shell).
168 // If in doubt, do not use.
169 StringType GetCommandLineStringWithUnsafeInsertSequences() const;
mgiucac974d512014-10-01 09:24:51170#endif
msw@chromium.org06cc083a2011-03-01 02:28:42171
gab@chromium.org45f982e2012-10-29 21:31:31172 // Constructs and returns the represented arguments string.
173 // CAUTION! This should be avoided on POSIX because quoting behavior is
174 // unclear.
Jesse McKenna036150c2020-07-17 21:11:17175 StringType GetArgumentsString() const;
gab@chromium.org45f982e2012-10-29 21:31:31176
estade@chromium.org10e42bf2008-10-15 21:59:08177 // Returns the original command line string as a vector of strings.
msw@chromium.org06cc083a2011-03-01 02:28:42178 const StringVector& argv() const { return argv_; }
estade@chromium.org10e42bf2008-10-15 21:59:08179
msw@chromium.orga40ca4302011-05-14 01:10:24180 // Get and Set the program part of the command line string (the first item).
brettw@chromium.org2f3b1cc2014-03-17 23:07:15181 FilePath GetProgram() const;
182 void SetProgram(const FilePath& program);
evan@chromium.org0189bbd2009-10-12 22:50:39183
msw@chromium.org06cc083a2011-03-01 02:28:42184 // Returns true if this command line contains the given switch.
jackhou1bd9da92015-05-21 04:48:00185 // Switch names must be lowercase.
186 // The second override provides an optimized version to avoid inlining codegen
187 // at every callsite to find the length of the constant and construct a
188 // StringPiece.
Wez65018d02021-05-20 15:47:45189 bool HasSwitch(StringPiece switch_string) const;
tapted009a1dc82015-03-30 03:57:10190 bool HasSwitch(const char switch_constant[]) const;
initial.commitd7cae122008-07-26 21:49:38191
msw@chromium.org06cc083a2011-03-01 02:28:42192 // Returns the value associated with the given switch. If the switch has no
193 // value or isn't present, this method returns the empty string.
jackhou1bd9da92015-05-21 04:48:00194 // Switch names must be lowercase.
Wez65018d02021-05-20 15:47:45195 std::string GetSwitchValueASCII(StringPiece switch_string) const;
196 FilePath GetSwitchValuePath(StringPiece switch_string) const;
197 StringType GetSwitchValueNative(StringPiece switch_string) const;
msw@chromium.org06cc083a2011-03-01 02:28:42198
msw@chromium.org06cc083a2011-03-01 02:28:42199 // Get a copy of all switches, along with their values.
200 const SwitchMap& GetSwitches() const { return switches_; }
201
202 // Append a switch [with optional value] to the command line.
msw@chromium.orga40ca4302011-05-14 01:10:24203 // Note: Switches will precede arguments regardless of appending order.
Wez65018d02021-05-20 15:47:45204 void AppendSwitch(StringPiece switch_string);
205 void AppendSwitchPath(StringPiece switch_string, const FilePath& path);
206 void AppendSwitchNative(StringPiece switch_string, StringPieceType value);
207 void AppendSwitchASCII(StringPiece switch_string, StringPiece value);
evan@chromium.org4f08c83f2010-07-29 23:02:34208
Pavol Markobf16b812019-06-14 00:53:12209 // Removes the switch that matches |switch_key_without_prefix|, regardless of
210 // prefix and value. If no such switch is present, this has no effect.
211 void RemoveSwitch(const base::StringPiece switch_key_without_prefix);
Avi Drissman1aa6cb92019-01-23 15:58:38212
Lei Zhang233b3cd2023-07-19 02:25:10213 // Copies a set of switches (and any values) from another command line.
msw@chromium.org06cc083a2011-03-01 02:28:42214 // Commonly used when launching a subprocess.
Lei Zhang233b3cd2023-07-19 02:25:10215 // If an entry in `switches` does not exist in `source`, then it is ignored.
Lei Zhang24dcd3e2023-07-07 20:08:36216 void CopySwitchesFrom(const CommandLine& source,
217 span<const char* const> switches);
218
msw@chromium.org06cc083a2011-03-01 02:28:42219 // Get the remaining arguments to the command.
msw@chromium.org75f1c782011-07-13 23:41:22220 StringVector GetArgs() const;
msw@chromium.org06cc083a2011-03-01 02:28:42221
222 // Append an argument to the command line. Note that the argument is quoted
223 // properly such that it is interpreted as one argument to the target command.
224 // AppendArg is primarily for ASCII; non-ASCII input is interpreted as UTF-8.
msw@chromium.orga40ca4302011-05-14 01:10:24225 // Note: Switches will precede arguments regardless of appending order.
Wez65018d02021-05-20 15:47:45226 void AppendArg(StringPiece value);
brettw@chromium.org2f3b1cc2014-03-17 23:07:15227 void AppendArgPath(const FilePath& value);
Wez65018d02021-05-20 15:47:45228 void AppendArgNative(StringPieceType value);
evan@chromium.orgbb975362009-01-21 01:00:22229
msw@chromium.orga40ca4302011-05-14 01:10:24230 // Append the switches and arguments from another command line to this one.
mayuko aibafa08692f2024-01-12 03:58:38231 // If `include_program` is true, program will be overwritten by other's.
msw@chromium.orga40ca4302011-05-14 01:10:24232 void AppendArguments(const CommandLine& other, bool include_program);
initial.commitd7cae122008-07-26 21:49:38233
msw@chromium.org06cc083a2011-03-01 02:28:42234 // Insert a command before the current command.
Mostyn Bramley-Moored0ecd6a2017-12-06 19:13:21235 // Common for debuggers, like "gdb --args".
Wez65018d02021-05-20 15:47:45236 void PrependWrapper(StringPieceType wrapper);
agl@chromium.org052f1d482009-02-10 00:52:14237
Xiaohan Wang38e4ebb2022-01-19 06:57:43238#if BUILDFLAG(IS_WIN)
msw@chromium.org06cc083a2011-03-01 02:28:42239 // Initialize by parsing the given command line string.
240 // The program name is assumed to be the first item in the string.
Jan Wilken Dörrieda77fd432019-10-24 21:40:34241 void ParseFromString(StringPieceType command_line);
David Bienvenuedbb4ce2022-09-28 16:02:16242
243 // Returns true if the command line had the --single-argument switch, and
244 // thus likely came from a Windows shell registration. This is only set if the
245 // command line is parsed, and is not changed after it is parsed.
246 bool HasSingleArgumentSwitch() const { return has_single_argument_switch_; }
msw@chromium.org06cc083a2011-03-01 02:28:42247#endif
evan@chromium.org4f08c83f2010-07-29 23:02:34248
Will Harrisee9f0a22023-03-02 21:38:58249 // Detaches this object from the current sequence in preparation for a move to
250 // a different sequence.
251 void DetachFromCurrentSequence();
252
Greg Gutermanfe16560d2021-10-07 19:58:15253 // Sets a delegate that's called when we encounter a duplicate switch
254 static void SetDuplicateSwitchHandler(
255 std::unique_ptr<DuplicateSwitchHandler>);
256
initial.commitd7cae122008-07-26 21:49:38257 private:
Will Harrisee9f0a22023-03-02 21:38:58258#if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS)
259 // A helper class that encapsulates a SEQUENCE_CHECKER but allows copy.
260 // Copying this class will detach the sequence checker from the owning object.
261 class InstanceBoundSequenceChecker {
262 public:
263 InstanceBoundSequenceChecker() = default;
264
265 InstanceBoundSequenceChecker(const InstanceBoundSequenceChecker& other) {}
266
267 InstanceBoundSequenceChecker& operator=(
268 const InstanceBoundSequenceChecker& other) {
269 return *this;
270 }
271
272 // Disallow move.
273 InstanceBoundSequenceChecker(InstanceBoundSequenceChecker&&) = delete;
274 InstanceBoundSequenceChecker& operator=(InstanceBoundSequenceChecker&&) =
275 delete;
276
277 void Detach() { DETACH_FROM_SEQUENCE(sequence_checker_); }
278 void Check() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); }
279
280 private:
281 SEQUENCE_CHECKER(sequence_checker_);
282 };
283#endif // BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS)
284
msw@chromium.orga40ca4302011-05-14 01:10:24285 // Disallow default constructor; a program name must be explicitly specified.
Chris Watkins091d6292017-12-13 04:25:58286 CommandLine() = delete;
sky@google.comd4515eb2009-01-30 00:40:43287
Jesse McKenna036150c2020-07-17 21:11:17288 // Append switches and arguments, keeping switches before arguments.
mayuko aibafa08692f2024-01-12 03:58:38289 // NOTE: `argv` should not include the "program" element.
290 void AppendSwitchesAndArguments(span<const StringType> argv);
mgiucac974d512014-10-01 09:24:51291
Jesse McKenna185ceda22021-03-10 06:47:55292 // Internal version of GetArgumentsString to support allowing unsafe insert
293 // sequences in rare cases (see
294 // GetCommandLineStringWithUnsafeInsertSequences).
295 StringType GetArgumentsStringInternal(
296 bool allow_unsafe_insert_sequences) const;
297
Xiaohan Wang38e4ebb2022-01-19 06:57:43298#if BUILDFLAG(IS_WIN)
Jesse McKenna036150c2020-07-17 21:11:17299 // Initializes by parsing |raw_command_line_string_|, treating everything
300 // after |single_arg_switch_string| + <a single character> as the command
301 // line's single argument, and dropping any arguments previously parsed. The
302 // command line must contain |single_arg_switch_string|, and the argument, if
303 // present, must be separated from |single_arg_switch_string| by one
304 // character.
305 // NOTE: the single-argument switch is not preserved after parsing;
306 // GetCommandLineStringForShell() must be used to reproduce the original
307 // command-line string with single-argument switch.
308 void ParseAsSingleArgument(const StringType& single_arg_switch_string);
309
310 // The string returned by GetCommandLineW(), to be parsed via
311 // ParseFromString(). Empty if this command line was not parsed from a string,
312 // or if ParseFromString() has finished executing.
313 StringPieceType raw_command_line_string_;
David Bienvenuedbb4ce2022-09-28 16:02:16314
315 // Set to true if the command line had --single-argument when initially
316 // parsed. It does not change if the command line mutates after initial
317 // parsing.
318 bool has_single_argument_switch_ = false;
Jesse McKenna036150c2020-07-17 21:11:17319#endif
mgiucac974d512014-10-01 09:24:51320
msw@chromium.org06cc083a2011-03-01 02:28:42321 // The singleton CommandLine representing the current process's command line.
evan@chromium.orgbb975362009-01-21 01:00:22322 static CommandLine* current_process_commandline_;
initial.commitd7cae122008-07-26 21:49:38323
msw@chromium.orga40ca4302011-05-14 01:10:24324 // The argv array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* }
msw@chromium.org06cc083a2011-03-01 02:28:42325 StringVector argv_;
evan@chromium.orgbb975362009-01-21 01:00:22326
msw@chromium.org06cc083a2011-03-01 02:28:42327 // Parsed-out switch keys and values.
kinuko@chromium.orgf6c34832010-05-24 10:39:59328 SwitchMap switches_;
evan@chromium.orgbb975362009-01-21 01:00:22329
msw@chromium.orga40ca4302011-05-14 01:10:24330 // The index after the program and switches, any arguments start here.
Peter Kastingde85e742022-06-01 17:41:54331 ptrdiff_t begin_args_;
Will Harrisee9f0a22023-03-02 21:38:58332
333#if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS)
334 InstanceBoundSequenceChecker sequence_checker_;
335#endif
initial.commitd7cae122008-07-26 21:49:38336};
337
Greg Gutermanfe16560d2021-10-07 19:58:15338class BASE_EXPORT DuplicateSwitchHandler {
339 public:
340 // out_value contains the existing value of the switch
341 virtual void ResolveDuplicate(base::StringPiece key,
342 CommandLine::StringPieceType new_value,
343 CommandLine::StringType& out_value) = 0;
344 virtual ~DuplicateSwitchHandler() = default;
345};
346
brettw@chromium.org2f3b1cc2014-03-17 23:07:15347} // namespace base
348
deanm@chromium.org02c87962008-10-06 10:25:35349#endif // BASE_COMMAND_LINE_H_