/// <summary> /// Display the commands that start with the specified string. /// </summary> /// <param name="s"></param> /// <returns>Returns true if matches exist, otherwise false.</returns> private static bool ShowCommandMatches(String s) { CommandCatalog catalog = new CommandCatalog(); List <CommandRef> matches = catalog.StartsWith(s); if (matches.Count > 0) { foreach (CommandRef c in matches) { Console.WriteLine("git: '" + s + "' is not a git command. See 'git --help'."); Console.WriteLine(); Console.WriteLine("Did you mean this?"); Console.Write(" "); Console.Write(c.getName()); for (int i = c.getName().Length + 8; i < 31; i++) { Console.Write(" "); } Console.Write(c.getUsage()); Console.WriteLine(); } return(true); } else { return(false); } }
/// <summary> /// Display the commands that start with the specified string. /// </summary> /// <param name="s"></param> /// <returns>Returns true if matches exist, otherwise false.</returns> private static bool ShowCommandMatches(String s) { CommandCatalog catalog = new CommandCatalog(); List<CommandRef> matches = catalog.StartsWith(s); if (matches.Count > 0) { foreach (CommandRef c in matches) { Console.WriteLine("git: '" + s + "' is not a git command. See 'git --help'."); Console.WriteLine(); Console.WriteLine("Did you mean this?"); Console.Write(" "); Console.Write(c.getName()); for (int i = c.getName().Length + 8; i < 31; i++) Console.Write(" "); Console.Write(c.getUsage()); Console.WriteLine(); } return true; } else { return false; } }