/// <summary> /// Execute a command on the Tcc API. /// </summary> /// <param name="name"></param> /// <param name="commandText"></param> /// <returns></returns> public uint ExecuteCmd(TccCommandName name, string commandArgs) { TccCommand cmd; try { cmd = TccCommandRepo.Get(name); } catch (Exception e) { Console.WriteLine(e.Message); return(1); } return(ExecuteCmd(cmd, ParseArgs(cmd, commandArgs))); }
/// <summary> /// Process and rewrite a command line with path mapping, etc, but call back with commandLineArgs object /// for further modification /// </summary> /// <param name="name"></param> /// <param name="commandArgs"></param> /// <param name="commandLineArgs"></param> /// <returns></returns> public uint ProcessCmd(TccCommandName name, StringBuilder commandArgs, Action <CommandLineArgs> commandLine) { try { var cmd = TccCommandRepo.Get(name); var commandLineArgs = ParseArgs(cmd, commandArgs.ToString()); if (commandLine != null) { commandLine(commandLineArgs); } commandArgs.Replace(" " + commandLineArgs.ToString()); } catch (Exception e) { Console.WriteLine(e.Message); return(1); } return(TccLib.RETURN_DEFER); }
public static TccCommand Get(TccCommandName name) { return Commands[name]; }
public static TccCommand Get(TccCommandName name) { return(Commands[name]); }
/// <summary> /// Process and rewrite a command line with path mapping, etc /// </summary> /// <param name="name"></param> /// <param name="commandArgs"></param> /// <returns></returns> public uint ProcessCmd(TccCommandName name, StringBuilder commandArgs) { return(ProcessCmd(name, commandArgs, null)); }