private object Help([NotNull] params object[] args) { if (args == null) { throw new ArgumentNullException("args"); } if (args.Length == 1) { Console.WriteLine("These shell commands are defined internally."); Console.WriteLine("Type `help' to see this list."); Console.WriteLine("Type `help name' to find out more about the function `name'."); Console.WriteLine("Type `help shell' to find out more about the shell in general."); Console.WriteLine("Optionaly: Type `man name' or `man shell' to see extended documentation."); Console.WriteLine(); // Generic help var funcs = NativeFunction.GetNames(); var lines = TerminalTableBuilder.BuildTable(funcs, Console.BufferWidth, 2); foreach (var line in lines) { Console.WriteLine(line); } } else if (args.Length >= 2) { var arg = args[1] as string; if (arg == null) { throw new NullReferenceException("arg"); } // Help for exact function if (string.Equals(arg, "shell")) { Console.WriteLine("Short shell information."); Console.WriteLine("Use 'left' and right' arrow to change caret position."); Console.WriteLine("Use 'up' and 'down' arrow to navigate in the hostory."); Console.WriteLine("Use 'tab' to complete current word. Or press 'tab tab' to see the list of commands which starts with curent word"); Console.WriteLine("Use 'enter' to execute whole expression."); } else { var fun = NativeFunction.TryLockup(arg); if (fun != null) { if (fun.help != null) { Console.WriteLine(fun.help); } else { Console.WriteLine(string.Format("Command '{0}' does not have help", fun.name)); } } else { Console.WriteLine(string.Format("Command '{0}' does not exists", arg)); } } } return(null); }