CLI.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #include <Atomic/Core/ProcessUtils.h>
  2. #include <Atomic/IO/Log.h>
  3. #include <Atomic/Engine/Engine.h>
  4. #include <ToolCore/ToolSystem.h>
  5. #include <ToolCore/License/LicenseSystem.h>
  6. #include "CLI.h"
  7. using namespace ToolCore;
  8. DEFINE_APPLICATION_MAIN(AtomicCLI::CLI);
  9. namespace AtomicCLI
  10. {
  11. CLI::CLI(Context* context) :
  12. Application(context)
  13. {
  14. }
  15. CLI::~CLI()
  16. {
  17. }
  18. void CLI::Setup()
  19. {
  20. const Vector<String>& arguments = GetArguments();
  21. for (unsigned i = 0; i < arguments.Size(); ++i)
  22. {
  23. if (arguments[i].Length() > 1 /* && arguments[i][0] == '-'*/)
  24. {
  25. String argument = arguments[i].Substring(1).ToLower();
  26. String value = i + 1 < arguments.Size() ? arguments[i + 1] : String::EMPTY;
  27. LOGINFOF("%s", argument.CString());
  28. }
  29. }
  30. engineParameters_["Headless"] = true;
  31. engineParameters_["ResourcePaths"] = "";
  32. }
  33. void CLI::Start()
  34. {
  35. context_->RegisterSubsystem(new ToolSystem(context_));
  36. // BEGIN LICENSE MANAGEMENT
  37. GetSubsystem<LicenseSystem>()->Initialize();
  38. // END LICENSE MANAGEMENT
  39. }
  40. void CLI::Stop()
  41. {
  42. }
  43. }