On Tue, Jul 22, 2008 at 08:01:29PM +0000, Johannes Schindelin wrote: > > This patch introduces a modified Damerau-Levenshtein algorithm into > Git's code base, and uses it with the following penalties to show some > similar commands when an unknown command was encountered: > > swap = 0, insertion = 1, substitution = 2, deletion = 4 > > A typical output would now look like this: > > $ git sm > git: 'sm' is not a git-command. See 'git --help'. > > Did you mean one of these? > am > rm > > The cut-off is at similarity rating 6, which was empirically determined > to give sensible results. > > As a convenience, if there is only one candidate, Git continues under > the assumption that the user mistyped it. Example: > > $ git reabse > WARNING: You called a Git program named 'reabse', which does > not exist. > Continuing under the assumption that you meant 'rebase' > [...] <SCNR> Or use a decent shell: When typing e.g.: git tsa<tab>, it yields: $ git status ---- corrections (errors 1) status -- show working-tree's status tag -- create tag object signed with GPG tar-tree -- create tar archive of the files in the named tree ---- original tsa and it even works for non git commands ;) </SCNR> Despite that, I really like your idea. **hint hint** One could even hook that for long options into parse-options. -- ·O· Pierre Habouzit ··O madcoder@xxxxxxxxxx OOO http://www.madism.org
Attachment:
pgpwKhoNndyj2.pgp
Description: PGP signature