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

Side by Side Diff: tools/gn/command_args.cc

Issue 269813002: Fix GN args merge issue for https://codereview.chromium.org/265693003 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 OutputString("Waiting for editor on \"" + FilePathToUTF8(file_to_edit) + 191 OutputString("Waiting for editor on \"" + FilePathToUTF8(file_to_edit) +
192 "\"...\n"); 192 "\"...\n");
193 ::WaitForSingleObject(info.hProcess, INFINITE); 193 ::WaitForSingleObject(info.hProcess, INFINITE);
194 ::CloseHandle(info.hProcess); 194 ::CloseHandle(info.hProcess);
195 } 195 }
196 return true; 196 return true;
197 } 197 }
198 198
199 #else // POSIX 199 #else // POSIX
200 200
201 void RunEditor(const base::FilePath& file_to_edit) { 201 bool RunEditor(const base::FilePath& file_to_edit) {
202 // Prefer $VISUAL, then $EDITOR, then vi. 202 // Prefer $VISUAL, then $EDITOR, then vi.
203 const char* editor_ptr = getenv("VISUAL"); 203 const char* editor_ptr = getenv("VISUAL");
204 if (!editor_ptr) 204 if (!editor_ptr)
205 editor_ptr = getenv("EDITOR"); 205 editor_ptr = getenv("EDITOR");
206 if (!editor_ptr) 206 if (!editor_ptr)
207 editor_ptr = "vi"; 207 editor_ptr = "vi";
208 208
209 std::string cmd(editor_ptr); 209 std::string cmd(editor_ptr);
210 cmd.append(" \""); 210 cmd.append(" \"");
211 211
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 "Or see \"gn help args\" for more variants.").PrintToStdout(); 338 "Or see \"gn help args\" for more variants.").PrintToStdout();
339 return 1; 339 return 1;
340 } 340 }
341 341
342 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchList)) 342 if (base::CommandLine::ForCurrentProcess()->HasSwitch(kSwitchList))
343 return ListArgs(args[0]); 343 return ListArgs(args[0]);
344 return EditArgsFile(args[0]); 344 return EditArgsFile(args[0]);
345 } 345 }
346 346
347 } // namespace commands 347 } // namespace commands
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698