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

Fix arguments starting with "-" being unrecognized #189

Merged
merged 2 commits into from Dec 12, 2016

Conversation

iRath96
Copy link
Contributor

@iRath96 iRath96 commented Dec 12, 2016

First of all, thank you for this amazing gem!

I recently ran into an issue that when passing arguments (like text, title or subtitle) that start with a "-", no notification would be displayed. I traced this bug down to NSUserDefaults, which doesn't like arguments like -title "-xyz" apparently. This PR implements a hack to get around this by inserting a space before such arguments (-title "-xyz" becomes -title " -xyz"). MacOS removes whitespace, so notifications are shown correctly (without the space) in the notification center.

Fixes a bug that causes arguments starting with "-" to not be recognized
@julienXX
Copy link
Owner

Thanks a lot @iRath96 ! Could you add a test to validate your PR please if that's not too complicated?

Add test case for arguments starting with a dash.
@iRath96
Copy link
Contributor Author

iRath96 commented Dec 12, 2016

@julienXX Added the test case. Let me know if there's anything else you need :)

@julienXX julienXX merged commit e562037 into julienXX:master Dec 12, 2016
@julienXX
Copy link
Owner

Thanks again!

@iRath96 iRath96 deleted the patch-1 branch December 12, 2016 18:03
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

Successfully merging this pull request may close these issues.

None yet

2 participants