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

slack-terminalize/util/_getCommand is too aggressive! #12

Open
alipourshahid opened this issue Sep 6, 2016 · 5 comments
Open

slack-terminalize/util/_getCommand is too aggressive! #12

alipourshahid opened this issue Sep 6, 2016 · 5 comments

Comments

@alipourshahid
Copy link

@ggauravr this is a great library. I am using it for my team. I have come across and issue though.

_getCommand also recognizes the beginning of the commands as valid commands. For instant, if the command is "help", "h" is also recognized as valid and works.

Is this currently as-designed?

It'd be nice to be able to config this to work as either exact match or contains (the current behaviour).

@ggauravr
Copy link
Owner

ggauravr commented Sep 8, 2016

@alipourshahid Glad to know it's useful for you! The only way it could work with h as a command is if you have actually defined it as a valid command or an alias to a valid command, like say as an alias for help.
Can you please paste a screenshot or something to help me understand the issue? Thanks again.

@alipourshahid
Copy link
Author

@ggauravr the problem is actually the fact that it works when h is used. so the command is help but when users type h in slack, help is detected. I think the issue is the RegEx is detecting any character set that the command starts with e.g. if you type h, he, hel, and help. They are all detected as help.

jamesallenuk added a commit to jamesallenuk/slack-terminalize that referenced this issue Mar 7, 2017
…d aliases in the userCommand list. Before it would match things like 'he' for 'help', 'g' for 'gem' etc.
@jamesallenuk
Copy link

Hopefully my PR sorts this out OK. I had to change the code after the regexp due to the difference in match results but think it simplifies the method without losing any logic.

@wjwolf79
Copy link

@jamesallenuk you're PR works perfectly. It really needs to get merged. I ended up moving the slack-terminalize to a local folder and making the changes there.

@ggauravr
Copy link
Owner

ggauravr commented Aug 20, 2017 via email

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

No branches or pull requests

4 participants