MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / GetOptionParts

Method GetOptionParts

src/Update/Mono.Options/Options.cs:1033–1050  ·  view source on GitHub ↗
(string argument, out string flag, out string name, out string sep, out string value)

Source from the content-addressed store, hash-verified

1031 @"^(?<flag>--|-|/)(?<name>[^:=]+)((?<sep>[:=])(?<value>.*))?$");
1032
1033 protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value)
1034 {
1035 if (argument == null)
1036 throw new ArgumentNullException ("argument");
1037
1038 flag = name = sep = value = null;
1039 Match m = ValueOption.Match (argument);
1040 if (!m.Success) {
1041 return false;
1042 }
1043 flag = m.Groups ["flag"].Value;
1044 name = m.Groups ["name"].Value;
1045 if (m.Groups ["sep"].Success && m.Groups ["value"].Success) {
1046 sep = m.Groups ["sep"].Value;
1047 value = m.Groups ["value"].Value;
1048 }
1049 return true;
1050 }
1051
1052 protected virtual bool Parse (string argument, OptionContext c)
1053 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected