import sys
from Process import *

if __name__ == "__main__":
    if sys.argv:
        if len(sys.argv) == 3 or len(sys.argv) == 4:
            ReceivedModuleId = sys.argv[1]; #"4A37B20E-97E3-4BF9-AD5D-73CEC6068857";
            Platform = sys.argv[2]; #0;
            BuildEnv = 2; # Production
            print("Received Module Id = " + ReceivedModuleId)
            print("Platform = " + Platform)
            print("BuildEnv = " + 'Staging' if BuildEnv == 1 else 'Production')
            if(len(sys.argv) == 4):
                JobName = sys.argv[3]; #0;
                print("JobName = " + JobName)
            
            if(len(sys.argv) == 4):
                ProcessParam(ReceivedModuleId, Platform, BuildEnv, JobName)
            elif(len(sys.argv) == 5):
                IsLocalCompile = sys.argv[4]
                print("Is Local Compile Flag = " + IsLocalCompile)
                ProcessParam(ReceivedModuleId, Platform, BuildEnv, JobName, IsLocalCompile)
            else:
                ProcessParam(ReceivedModuleId, Platform, BuildEnv)
        elif len(sys.argv) == 1:
            print("No Argument")
        else:
            print(len(sys.argv))
            print("Argument length not equal to 3")