static int Main(string[] args) { var cmdParam = new CmdParam(args); if (cmdParam.ContainsUasgeParam()) { Console.WriteLine(CmdMessage.GetUsage()); } else if (cmdParam.IsError()) { Console.WriteLine(CmdMessage.GetUsageErrorPrompt()); return(Error); } else { ShowCurrentDirectory(); var cmdEntry = new CmdEntry(cmdParam); foreach (var line in cmdEntry.GetExecuteResult()) { Console.WriteLine(line); } } return(Success); }
public static int Main(string[] args) { var cmdParam = new CmdParam(args); if (cmdParam.ContainsUasgeParam()) { Console.WriteLine(CmdMessage.GetUsage()); } else if (Console.IsInputRedirected) { var cmdEntry = new CmdEntry(GetRedirectedInput(), cmdParam); foreach (var line in cmdEntry.GetExecuteResult()) { Console.WriteLine(line); } } else { Console.WriteLine(CmdMessage.GetUsageErrorPrompt()); return(Error); } return(Success); }