carlhuda/bundler — pull request #2050 by jdelStrother (2012-08-09 08:49:50+00:00)
Title: Suggesting typos in 'bundle open foo'

This is more like an RFC than a genuine pull request, but anyway:

I use 'bundle open' a ridiculous number of times each day, but can never remember whether it's thinking_sphinx or thinking-sphinx, delayed-job or delayed_job, and so on.

This commit crowbars some Levenshtein loving into cli.rb

```
$ bundle open thinking_sphinx
Could not find gem 'thinking_sphinx' in the current bundle.
Did you mean thinking-sphinx?
$ bundle open rke
Could not find gem 'rke' in the current bundle.
Did you mean one of rake, hike or ffi?
$ bundle open awss3
Could not find gem 'awss3' in the current bundle.
Did you mean aws-s3?
```

But it does feel kinda messy and inconsistent - it doesn't work with "bundle update foo", for example, mostly because it doesn't fit so easily into the top-level CLI#update and it seems wrong to start putting stuff like this deeper into the library.

Any thoughts? Would you like to see something like this in Bundler, or is it better off waiting for the fabled plugin architecture?