protected override string Execute(string command, MissionStatus mission) { var splited = command.Split(' '); string res; if (splited.Length < 3) { return("Wrong syntax. Type list -c [category]."); } if (splited[2] == "programming") { res = "APISql \n" + "SQL \n" + "Log \n"; } else if (splited[2] == "engineer") { res = "n/a"; } else if (splited[2] == "scientist") { res = "n/a"; } else { res = "there is no ctegory " + splited[2] + " type programming, engineer or scientist"; } return(res); }
protected override string Execute(string command, MissionStatus mission) { return("This command is sending SQL command to server and returning it's respond \n" + "-h : help\n" + "-l : list of sql commands with short description \n" + "-s [command] : sending command"); }
protected override string Execute(string command, MissionStatus mission) { string help = "To look for specyfic category of commands type -c \n" + "APISql \n" + "SQL \n" + "Log \n"; return(help); }
public string Run(string command, MissionStatus mission) { var splited = command.Split(); if (splited[0].ToLower() == name.ToLower()) { return(Execute(command, mission)); } return(_next == null ? "No such command. Type list for list of commands." : _next.Run(command, mission)); }
protected override string Execute(string command, MissionStatus mission) { string help = "This command is handling Log administration\n" + "-h : help\n" + "-sh : showing all logs\n" + "-sc : showing logs of one category\n" + "-n [category] [log] : adding new log \n"; return(help); }
static void Main(string[] args) { MissionStatus status = new MissionStatus(); ChainGenerator generator = new ChainGenerator(); while (true) { string command = Console.ReadLine(); Console.WriteLine(generator.ExecuteCommand(command, status)); } }
protected override string Execute(string command, MissionStatus mission) { string help = "This command is handling communication with server thru API \n" + "-h : help for command\n" + "-c [mission] [columns] : creating new mission of server\n" + "-su [mission] [atribut] [times + values] : sending update of atribut\n" + "-ru [mission] [atribut] [time] : downloading update of atribut from selected time and saving it to db\n" + "-gc [mission] : checking if time of atribut is up to date\n"; return(help); }
public string Run(string command, MissionStatus mission) { var splited = command.Split(); if (splited.Length == 1) { return(name == "-h" ? Execute(command, mission) : _next.Run(command, mission)); } if (splited[1].ToLower() == name.ToLower()) { return(Execute(command, mission)); } return(_next == null ? "No such argument. Type -h to find help." : _next.Run(command, mission)); }
protected override string Execute(string command, MissionStatus mission) { return(SendToServer(GenerateCommand(command), mission.IP, mission.port)); }
protected override string Execute(string command, MissionStatus mission) { return(_aguments[0].Run(command, mission)); }
public string ExecuteCommand(string command, MissionStatus mission) { return(commands[0].Run(command, mission)); }
protected abstract string Execute(string command, MissionStatus mission);
protected override string Execute(string command, MissionStatus mission) { return("Select \nCreate"); }