Decrease amount of suggestions

Bug #396829 reported by Nick Ellery
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Fix Released
Low
Michael Vogt

Bug Description

Binary package hint: command-not-found

command-not-found should limit the amount of suggests it offers.

For example if you accidentally type 'l' instead of 'ls', the following happens:
$ l
No command 'l' found, did you mean:
 Command 'el' from package 'oneliner-el' (universe)
 Command 'cl' from package 'cl-launch' (universe)
 Command 'vl' from package 'atfs' (universe)
 Command 'al' from package 'mono-devel' (main)
 Command 'ld' from package 'binutils' (main)
 Command 'ld' from package 'hardening-wrapper' (main)
 Command 'ld' from package 'binutils-gold' (universe)
 Command 'le' from package 'le' (universe)
 Command 'nl' from package 'coreutils' (main)
 Command 'ln' from package 'coreutils' (main)
 Command 'lh' from package 'live-helper' (universe)
 Command 'li' from package 'limo' (universe)
 Command 'lv' from package 'lv' (universe)
 Command 'ls' from package 'coreutils' (main)
 Command 'lp' from package 'cups-client' (main)
 Command 'lp' from package 'lprng' (universe)
 Command 'rl' from package 'randomize-lines' (universe)
 Command 'lz' from package 'mtools' (main)
 Command 'pl' from package 'tendra' (universe)
 Command 'bl' from package 'gpe-conf' (universe)
 Command 'sl' from package 'sl' (universe)
 Command 'i' from package 'iprint' (universe)
 Command 'r' from package 'littler' (universe)
 Command 'w' from package 'w-bassman' (universe)
 Command 'w' from package 'procps' (main)
 Command 'ul' from package 'bsdmainutils' (main)

This is seems useless, and the maximum amount of suggests ought to be decreased. It also doesn't seem likely that a user would attempt to use command-not-found to help them find a package by using a single letter.

Michael Vogt (mvo)
Changed in command-not-found (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Michael Vogt (mvo) wrote :

I set the minimal length for a mis typed command to two now. The problem with making the number of suggestions smaller is that there is currently no "ranking" whatsoever to know how/where to cut the number of suggestions. I guess it should print something like "there are 10 alternative spellings for this command" or something in the case where there are a lot of suggestions?

Revision history for this message
Nick Ellery (nick.ellery) wrote :

I don't see much of a reason to display that there are other suggestions unless there is some obvious way to see them. Although, I think it would be useful for people to be able to use this feature as a way for finding an application, which could require being able to see more.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package command-not-found - 0.2.37ubuntu1

---------------
command-not-found (0.2.37ubuntu1) karmic; urgency=low

  * CommandNotFound/CommandNotFound.py:
    - set min_length for mispelling suggestion to 3 (LP: #396829)
    - set max_length for mispelling suggestion to 15, if there
      are more, just a summary is printed

 -- Michael Vogt <email address hidden> Fri, 10 Jul 2009 10:44:00 +0200

Changed in command-not-found (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.