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

Question: Does the library include/expose a utility to convert a string into args? #375

Closed
Korporal opened this issue Nov 30, 2018 · 1 comment

Comments

@Korporal
Copy link

I was wondering if the library has this ability, I'd expect you to possibly rely on something like this for unit testing. Ideally I could supply a string that is (literally) a copy of a typed in arg list, and have that broken up into a set of smaller strings (like .Split does but clearly more intelligent).

I'd like to use this for unit testing my own applications hence my question (I'd rather not write my own).

@nemec
Copy link
Contributor

nemec commented Nov 30, 2018

For unit testing I format most CLIs in a way that Split handles correctly. If it doesn't work, I create an array manually.

You could try PInvoking what Windows does (or find the equivalent in the .NET Core codebase): https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-commandlinetoargvw

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

3 participants