electron_command_line.h 941 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (c) 2015 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_COMMON_ELECTRON_COMMAND_LINE_H_
  5. #define SHELL_COMMON_ELECTRON_COMMAND_LINE_H_
  6. #include "base/command_line.h"
  7. #include "base/macros.h"
  8. #include "build/build_config.h"
  9. namespace electron {
  10. // Singleton to remember the original "argc" and "argv".
  11. class ElectronCommandLine {
  12. public:
  13. static const base::CommandLine::StringVector& argv() { return argv_; }
  14. static void Init(int argc, base::CommandLine::CharType** argv);
  15. #if defined(OS_LINUX)
  16. // On Linux the command line has to be read from base::CommandLine since
  17. // it is using zygote.
  18. static void InitializeFromCommandLine();
  19. #endif
  20. private:
  21. static base::CommandLine::StringVector argv_;
  22. DISALLOW_IMPLICIT_CONSTRUCTORS(ElectronCommandLine);
  23. };
  24. } // namespace electron
  25. #endif // SHELL_COMMON_ELECTRON_COMMAND_LINE_H_