// found in the LICENSE file.
#include "atom/app/atom_main_args.h"
-#include "vendor/node/deps/uv/include/uv.h"
+
+#include "base/command_line.h"
+#include "node/deps/uv/include/uv.h"
namespace atom {
}
}
+#if defined(OS_LINUX)
+// static
+void AtomCommandLine::InitializeFromCommandLine() {
+ argv_ = base::CommandLine::ForCurrentProcess()->argv();
+}
+#endif
+
} // namespace atom
#include <string>
#include <vector>
-#include "base/macros.h"
+#include "base/basictypes.h"
namespace atom {
static void Init(int argc, const char* const* argv);
static std::vector<std::string> argv() { return argv_; }
+#if defined(OS_LINUX)
+ // On Linux the command line has to be read from base::CommandLine since
+ // it is using zygote.
+ static void InitializeFromCommandLine();
+#endif
+
private:
static std::vector<std::string> argv_;
node::g_standalone_mode = is_browser_;
node::g_upstream_node_mode = false;
+#if defined(OS_LINUX)
+ // Get real command line in renderer process forked by zygote.
+ if (!is_browser_)
+ AtomCommandLine::InitializeFromCommandLine();
+#endif
+
// Parse the debug args.
auto args = AtomCommandLine::argv();
for (const std::string& arg : args)