ThrowTheSwitch / CMock

CMock - Mock/stub generator for C
http://throwtheswitch.org
MIT License
672 stars 273 forks source link

Cmock regexps for argument parsing are a bit strict #336

Closed ollehu closed 3 years ago

ollehu commented 3 years ago

Hi,

In lib/cmock.rb we can find regexps for -o outputfile and --key=value arguments. These are

^-o\"?([a-zA-Z0-9._\\\/:\s]+)\"?

and

^--([a-zA-Z0-9._\\\/:\s]+)=\"?([a-zA-Z0-9._\-\\\/:\s\;]+)\"?

respectively. We have found that filepaths generated by Jenkins for parallel jobs may contain an @ character, which we would like to introduce in the first regexp.

As for the second one, we find it too strict for the --strippables argument that should allow for a regexp, that is, --strippable="a valid regexp". I'm interested in extending this one to be more compliant with regexps. Or, perhaps even better, check if we are given a --strippable argument and then allow everything following the =-sign, assuming that the user can write proper regexp.

Is such a pull request encouraged?

mvandervoord commented 3 years ago

Absolutely! Those things both make sense to me. Thanks for looking into it! :)

ollehu commented 3 years ago

Thank you for the quick reply. Could you point out the unit test file for arguments to cmock.rb for me (if there is one)?

ollehu commented 3 years ago

@mvandervoord Have you had a look at the referenced pull request (PR)?

mvandervoord commented 3 years ago

Thanks for the idea, the work, and the reminder! You're awesome, @ollehu !