public static string GetTopSuggestion(CommandLineApplication command, string input) { var candidates = GetCandidates(command).ToList(); if (candidates.Count == 0) { return(null); } var bestMatch = StringDistance.GetBestMatchIndex(StringDistance.DamareuLevenshteinDistance, input, candidates.Select(c => c.CompareValue).ToArray(), 0.33d); return(bestMatch > -1 ? candidates[bestMatch].DisplayValue : null); }