forked from electron/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelectron_command_line.cc
More file actions
36 lines (27 loc) · 978 Bytes
/
electron_command_line.cc
File metadata and controls
36 lines (27 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/common/electron_command_line.h"
#include "base/command_line.h"
#include "uv.h" // NOLINT(build/include_directory)
namespace electron {
// static
base::CommandLine::StringVector ElectronCommandLine::argv_;
// static
void ElectronCommandLine::Init(int argc, base::CommandLine::CharType** argv) {
DCHECK(argv_.empty());
// NOTE: uv_setup_args does nothing on Windows, so we don't need to call it.
// Otherwise we'd have to convert the arguments from UTF16.
#if !BUILDFLAG(IS_WIN)
// Hack around with the argv pointer. Used for process.title = "blah"
argv = uv_setup_args(argc, argv);
#endif
argv_.assign(argv, argv + argc);
}
#if BUILDFLAG(IS_LINUX)
// static
void ElectronCommandLine::InitializeFromCommandLine() {
argv_ = base::CommandLine::ForCurrentProcess()->argv();
}
#endif
} // namespace electron