/// <summary> /// Parse the command arguments for the read-feed command. /// </summary> /// <param name="args"></param> /// <param name="idx"></param> /// <param name="switchOut"></param> /// <returns></returns> public override int Parse(string[] args, int idx, out Switch switchOut) { // check next argument. if (args.Length < idx) { throw new SwitchParserException("None", "Invalid path for read-feed command!"); } // everything ok, take the next argument as the path. switchOut = new SwitchReadFeed() { Path = args[idx] }; return 1; }
/// <summary> /// Parses string arguments into an actual command object. /// </summary> /// <param name="args"></param> /// <param name="idx"></param> /// <param name="switchOut"></param> /// <returns></returns> public abstract int Parse(string[] args, int idx, out Switch switchOut);
/// <summary> /// Parse the command arguments for the write-feed command. /// </summary> /// <param name="args"></param> /// <param name="idx"></param> /// <param name="switchOut"></param> /// <returns></returns> public override int Parse(string[] args, int idx, out Switch switchOut) { switchOut = new SwitchValidateFeed(); return 0; }