Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: base/command_line.h

Issue 19740: Merge r2876 to the 1.0 release branch.... (Closed) Base URL: svn://chrome-svn/chrome/branches/release_154.next/src/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/command_line.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/command_line.h
===================================================================
--- base/command_line.h (revision 8989)
+++ base/command_line.h (working copy)
@@ -1,16 +1,17 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-//
+
// This file contains a class that can be used to extract the salient
// elements of a command line in a relatively lightweight manner.
// Switches can optionally have a value attached using an equals sign,
// as in "-switch=value". Arguments that aren't prefixed with a
// switch prefix are considered "loose parameters". Switch names
-// are case-insensitive.
+// are case-insensitive. An argument of "--" will terminate switch parsing,
+// causing everything after to be considered as loose parameters.
-#ifndef BASE_COMMAND_LINE_H__
-#define BASE_COMMAND_LINE_H__
+#ifndef BASE_COMMAND_LINE_H_
+#define BASE_COMMAND_LINE_H_
#include <map>
#include <string>
@@ -76,6 +77,9 @@
// The string that's used to separate switches from their values.
static const wchar_t kSwitchValueSeparator[];
+ // Treat everything after this argument as loose parameters.
+ static const wchar_t kSwitchTerminator[];
+
// Appends the given switch string (preceded by a space and a switch
// prefix) to the given string.
static void AppendSwitch(std::wstring* command_line_string,
@@ -101,5 +105,4 @@
DISALLOW_EVIL_CONSTRUCTORS(CommandLine);
};
-#endif // BASE_COMMAND_LINE_H__
-
+#endif // BASE_COMMAND_LINE_H_
« no previous file with comments | « no previous file | base/command_line.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698