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

Improve command line argument quoting logic #335

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Improve command line argument quoting logic #335

wants to merge 2 commits into from

Commits on Jul 16, 2019

  1. We hit an issue where C# generator tool would exit with no error mess…

    …age and no files generated.
    
    After troubleshooting I root-caused the issue to .NET command line parsing rules, where special characters like double-quotes and backslashes have to be escaped under some circumstances.
    
    There already was a code to handle some of these cases, but it didn't cover the following:
    1) When there are multiple backslashes preceeding the double-quote, we need to escape all of them, not only the last one.
    2) When there is a backslash at the end of the argument, we need to escape it, otherwise it will escape the double-quote appended by the code itself, causing attribute value to run out when parsed by .NET infrastructure.
    
    This change is improving the logic to account for these two extra cases. I also added unit tests to demonstrate the behavior. In order to do so, I had to move the JoinArguments methd to a public helper class, so that it can be accessed from unit tests, as I'm not a big fan of InternalsVisibleTo.
    nahk-ivanov committed Jul 16, 2019
    Configuration menu
    Copy the full SHA
    ad08dff View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2019

  1. Mark new CommandLineHelper class as internal and expose it to tests b…

    …y using InternalsVisibleTo attribute
    nahk-ivanov committed Aug 11, 2019
    Configuration menu
    Copy the full SHA
    8af0a44 View commit details
    Browse the repository at this point in the history