Skip to content
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

Additional short browser names available from command line #2

Open
jakub-g opened this issue Nov 17, 2014 · 3 comments
Open

Additional short browser names available from command line #2

jakub-g opened this issue Nov 17, 2014 · 3 comments

Comments

@jakub-g
Copy link

jakub-g commented Nov 17, 2014

It's good to have descriptive variable names and values in the command line, but it's also useful to have their shorter counterparts available to save some typing.

So, we could accept fx (and/or ff), ch, ie, safor sth like that to mean firefox, chrome, internet explorer, safari

@ymeine
Copy link

ymeine commented Nov 17, 2014

Very good idea!

But I would also like ffx for Firefox for instance.

In this case, since we can't foresee the habits of all the users, I guess it would be good to perform a fuzzy match to hit the collection of browsers from the user input. For that, a ranking with Levenshtein distances and a threshold minimum distance could do the trick. There are even npm modules to do the computations.

@jakub-g
Copy link
Author

jakub-g commented Nov 17, 2014

Hmm looks doable. It will have an added benefit of being able to type internet exploder for instance ;)

The current names + a few suggested ones could be embedded as bases.
If I type something nonsense like ww, it has same Levenshtein distance to ie and ch, then if multiple opts give the same distance, we just print out an error message, otherwise we select the closest one

@ymeine
Copy link

ymeine commented Nov 17, 2014

If we get only one closest match, indeed we can choose it, and otherwise we log an error. But in some cases, if even the closest match has a too long distance, I would also log an error, since it loses its sense. Hence the idea of a threshold distance. Also we could log to the user which browser we selected. Anyway, the names are not too long, there are not so many and they are not too close, so there shouldn't be real problem, I'm just being perfectionist here :p

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

No branches or pull requests

2 participants