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

Support for .NET standard #34

Closed
fleed opened this issue Mar 31, 2017 · 9 comments
Closed

Support for .NET standard #34

fleed opened this issue Mar 31, 2017 · 9 comments

Comments

@fleed
Copy link

fleed commented Mar 31, 2017

Any plan on plan on supporting .NET standard?

Even 1.6 would be enough.

@fschwiet
Copy link
Owner

fschwiet commented Apr 3, 2017

One problem is .NET standard doesn't implement anything like CommandLineToArgv (https://github.com/fschwiet/ManyConsole/blob/master/ManyConsole/Internal/CommandLineParser.cs) so we have that Win32 dependency. This is only needed for the console mode command, so it could be split out.

But generally, I don't expect I'll be writing console applications for a non-Win32 platform anytime soon so I don't think I'll have motivation to support .NET standard. When/if I do I might rather do a ManyConsole2 instead (since over time I've found enough things I would do differently).

If you're console is only running on Win32 then I think you could split it out such that only the console portion of your code isn't .NET standard. Otherwise you might want to consider https://www.nuget.org/packages/Mono.Options.Core/. ManyConsole extends NDesk.Options which is a prior version of Mono.Options.

@brainwipe
Copy link

I've enjoyed using ManyConsole (thank you Frank!) and would like to add my support behind using it .NET standard. I'll be watching keenly if you decide to do ManyConsole2.

@brainwipe
Copy link

While researching how I might help, I discovered this interesting article: https://msdn.microsoft.com/en-us/magazine/mt763239.aspx

It seems they've built more into .NET core but I am unsure it will help with this particular issue!

@bbrandt
Copy link

bbrandt commented Nov 1, 2017

@brainwipe Support for Microsoft.Extensions.CommandLineUtils has been discontinued. However, Nate McMaster, a software engineer on the ASP.NET Core project, has since forked the project as a community project in his free time.

@fschwiet
Copy link
Owner

fschwiet commented Nov 1, 2017

Nate has added is parsing of response files for the command line parameters

@bbrandt I didn't really follow his last commit related to response files. If he does have code that would parse a string representing a line entered at the prompt into an args string[] then yes that should be enough to get ManyConsole running on .Net core. I worry though different platforms might have different behaviors on how this parsing happens, and that needs to be considered as part of becoming cross-platform. One could also just push the part of the code that needs this parsing into a separate package that doesn't become cross-platform (the parsing is used by the ConsoleModeCommand, which I don't think is typically used).

I don't have the time/energy to work on it though, nor the need. Happy to answer questions though if people want to run with it.

@pinkfloydx33
Copy link

I stumbled upon this algorithm which is supposedly what WinAPI uses for GetCommandLineToArgsW -- only as an Ansi version. Its in C, but could be used as a basis for converting to C# (with some tweaking) -- It could also help alleviate parts of #9 where ConsoleModeCommand "distorts" the arguments passed to it

@bbrandt
Copy link

bbrandt commented Nov 2, 2017

Apologies @fschwiet, I forgot to tag @brainwipe to indicate I was responding specifically to his comment. I also edited my comment as I realize I added a whole lot of information that was responding to a specific comment instead of being part of the solution we are working towards in this thread. Sorry about the confusion!

@brainwipe
Copy link

Thank you @bbrandt, I spotted Nate's post and have implemented his library, which does the job well in .NET Core.

@fschwiet
Copy link
Owner

fschwiet commented Jul 4, 2019

.NET standard is supported in 2.0

@fschwiet fschwiet closed this as completed Jul 4, 2019
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 a pull request may close this issue.

5 participants