public int Run(Cli console,string[] args) { console.Out.Write(_waitText); console.In.Read(); console.Out.WriteLine(); return 0; }
public int Run(Cli console,string[] args) { string source = null; string local = null; Options opts = new Options("Downloads a specified file") { new Option((string s)=>source =s,"address","The source address of the file to be downloaded"), new Option((string l)=>local =l,"localFile","Save the remote file as this name"), }; opts.Parse(args); if(source == null) { return 1; } using(var client = new System.Net.WebClient()) { if(local !=null) { client.DownloadFile(new Uri(source),local); } else { var result = client.DownloadString(new Uri(source)); console.Out.WriteLine(result); } } return 0; }
public int Run(Cli console,string[] args) { int time =0; Options opts = new Options("Waits for a period of time") { new Option((int t)=>time =t,"WaitTime","Time in milliseconds to sleep for") }; opts.Parse(args); Thread.Sleep(time); return 0; }
public int Run(Cli console,string[] args) { Console.Beep(); return 0; }
public int Run(Cli console,string[] args) { console.Out.WriteLine(string.Join(" ",args)); return 0; }
public int Run(Cli console,string[] args) { _shell.Stop(); return 0; }