/// <summary> /// Runs this command. /// </summary> /// <returns>Return code for the command</returns> public int Run() { Program.DisplayHeader(); var robots = RobotConfiguration.Load().ToList(); if (robots.Count == 0) { Console.WriteLine("There are no Vector robots configured."); return(-1); } string robotName = Authentication.StandardizeRobotName(NameOrSerial); string serial = NameOrSerial.ToLower(); var robot = robots.FirstOrDefault(r => r.RobotName == robotName || r.SerialNumber.ToLower() == serial); if (robot == null) { Console.WriteLine($"Robot '{NameOrSerial}' was not found."); return(-1); } robots.RemoveAt(robots.IndexOf(robot)); RobotConfiguration.Save(robots); Console.WriteLine($"Removed {robot.RobotName} ({robot.SerialNumber})."); return(0); }
/// <summary> /// Runs this command. /// </summary> /// <returns>Return code for the command</returns> public int Run() { Program.DisplayHeader(); var robots = RobotConfiguration.Load().ToList(); if (robots.Count == 0) { Console.WriteLine("There are no Vector robots configured."); return(0); } Console.WriteLine("Configured Vector Robots:"); if (Verbose) { DisplayRobotsVerbose(robots); } else { DisplayRobotsNormal(robots); } return(0); }