Re: [TOY PATCH] git wrapper: show similar command names for an unknown command

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Johannes Schindelin
Date: Saturday, June 7, 2008 - 8:04 am

Hi,

On Sat, 7 Jun 2008, Alex Riesen wrote:



How about this instead?

-- snipsnap --

 help.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/help.c b/help.c
index bd51852..173e502 100644
--- a/help.c
+++ b/help.c
@@ -655,7 +655,7 @@ void help_unknown_cmd(const char *cmd)
 	qsort(main_cmds.names, main_cmds.cnt,
 	      sizeof(*main_cmds.names), levenshtein_compare);
 
-	for (i = 0; i < main_cmds.cnt; i++) {
+	for (i = 0; i < main_cmds.cnt && i < 5; i++) {
 		int s = similarity(main_cmds.names[i]->name);
 		if (s > 6)
 			break;
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[TOY PATCH] git wrapper: show similar command names for an ..., Johannes Schindelin, (Wed Jun 4, 11:48 pm)
Re: [TOY PATCH] git wrapper: show similar command names fo ..., Johannes Schindelin, (Thu Jun 5, 4:00 pm)
Re: [TOY PATCH] git wrapper: show similar command names fo ..., Johannes Schindelin, (Sat Jun 7, 8:04 am)
Re: [TOY PATCH] git wrapper: show similar command names fo ..., Johannes Schindelin, (Sun Jun 8, 8:07 am)
Re: [TOY PATCH] git wrapper: show similar command names fo ..., Johannes Schindelin, (Sun Jun 8, 4:26 pm)