No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ParseArguments.cs 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Collections.Generic;
  2. namespace Unity.PlasticSCM.Editor.ProjectDownloader
  3. {
  4. internal static class ParseArguments
  5. {
  6. internal static string CloudProject(Dictionary<string, string> args)
  7. {
  8. string data;
  9. if (!args.TryGetValue(CLOUD_PROJECT, out data))
  10. return null;
  11. return data;
  12. }
  13. internal static string CloudOrganization(Dictionary<string, string> args)
  14. {
  15. string data;
  16. if (!args.TryGetValue(CLOUD_ORGANIZATION, out data))
  17. return null;
  18. return GetOrganizationNameFromData(data);
  19. }
  20. internal static string ProjectPath(Dictionary<string, string> args)
  21. {
  22. string data;
  23. if (!args.TryGetValue(CREATE_PROJECT, out data))
  24. return null;
  25. return data;
  26. }
  27. static string GetOrganizationNameFromData(string data)
  28. {
  29. // data is in format: 151d73c7-38cb-4eec-b11e-34764e707226-danipen-unity
  30. int guidLenght = 36;
  31. if (data.Length < guidLenght + 1)
  32. return null;
  33. return data.Substring(guidLenght + 1);
  34. }
  35. const string CLOUD_PROJECT = "-cloudProject";
  36. const string CLOUD_ORGANIZATION = "-cloudOrganization";
  37. const string CREATE_PROJECT = "-createProject";
  38. }
  39. }