elm-lang / elm-package

Command line tool to share Elm libraries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add search command to find packages based on query

ahstro opened this issue · comments

I often find myself needing to install a package but not remembering or knowing it's exact name. In this scenario, it would be useful to have a search command that would show a list of packages with similar names as the input argument.

This feature already sort of exists as part of the install command; if an invalid package name is supplied, it shows a list of packages with similar names, e.g., elm package install elm-lang/htmll outputs this:

Error: Could not find any packages named elm-lang/htmll.

Here are some packages that have similar names:

    elm-lang/html
    elm-lang/http
    elm-lang/dom
    elm-lang/core

Maybe you want one of those?

It should be relatively simple to use this same feature - Error.nearbyNames - to implement a search command that does essentially the same thing, but with slightly different copy.

I tried this myself, but have been unsuccessful due to lack of time and trouble building elm-package on my machine, so I thought I'd create an issue before putting in too much effort. (Edit: If someone could point me in directions to instructions on how to build from source, that'd be much appreciated 😇 )

Is this a good idea, does it exist (and I'm blind), or should install be used for this purpose?

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.