You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move Parse extension methods to the appropriate Symbol types #1901
// This method group looks fine, but should be an instance method on Argument, or a non-extension method somewhere else.// I recommend using different names for the two overloads. That would allow you to use `params string[] args` for the latter.// Argument::Parse(string) and Argument::ParseArguments(params string[] args), maybe?publicstaticParseResultParse(thisArgumentargument,stringcommandLine);publicstaticParseResultParse(thisArgumentargument,string[]args);}
params string[] args doesn't seem that useful here, anyway. Callers would usually have the args in a collection object already, except perhaps in tests where you can just do new[] { "…", … }.
params string[] args doesn't seem that useful here, anyway. Callers would usually have the args in a collection object already, except perhaps in tests where you can just do new[] { "…", … }.
And we've been trying to discourage testing that way because it requires you to know how the command line input string will be split into an array of strings, which is not at all straightforward: #1758.
Activity
KalleOlaviNiemitalo commentedon Nov 5, 2022
Call it ParseArgumentList so it is similar to ProcessStartInfo.ArgumentList.
jonsequitur commentedon Nov 6, 2022
One possible concern there is that "argument" means something more specific in the context of the parser.
KalleOlaviNiemitalo commentedon Nov 8, 2022
params string[] argsdoesn't seem that useful here, anyway. Callers would usually have the args in a collection object already, except perhaps in tests where you can just donew[] { "…", … }.jonsequitur commentedon Nov 11, 2022
And we've been trying to discourage testing that way because it requires you to know how the command line input string will be split into an array of strings, which is not at all straightforward: #1758.
KalleOlaviNiemitalo commentedon Nov 11, 2022
It's well understood for POSIX sh.
adamsitnik commentedon Nov 14, 2022
fixed in #1951