New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command aliases or fuzzy command lookup? #5

Closed
randycoulman opened this Issue May 13, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@randycoulman
Copy link
Contributor

randycoulman commented May 13, 2017

Thanks again for this library! I'm finding it really helpful on a little side/learning project I've been working on.

I recently found myself wanting to provide aliases for my commands so that I could use a shorter name on the command line. One way to do this would be to add an aliases option to Command, and then modify command lookup to take aliases into account.

However, I see in the README that one of the roadmap ideas is

fuzzy handling of command (i.e. npm insta will run npm install)

A first cut at fuzzy handling would likely involve just matching prefixes; that could be improved later if needed. Doing a prefix match would also address my need, as the aliases I want to define are prefixes of the full command names.

I've looked through the code, and I don't think it would be terribly difficult to implement either of these ideas.

I'm willing to start working on a PR for this, but first I'd like to know which of these two directions you'd prefer.

Do you prefer the fuzzy (starting with prefix) matching? Or do you prefer the alias idea?

My time is somewhat limited, so I can't guarantee how fast I can get this done, but I'm willing to do the work on it.

@danhper

This comment has been minimized.

Copy link
Owner

danhper commented May 14, 2017

Hi, and thank you very much for offering to help.
I would rather go with command aliases, as it is more controllable
than fuzzy matching, and I think enough for most use cases.
I have been busy recently too, and am in absolutely no hurry,
so any help would be greatly appreciated.
Thank you very much 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment