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

Method AddSeparators

src/SyncReleases/Mono.Options/Options.cs:517–547  ·  view source on GitHub ↗
(string name, int end, ICollection<string> seps)

Source from the content-addressed store, hash-verified

515 }
516
517 private static void AddSeparators (string name, int end, ICollection<string> seps)
518 {
519 int start = -1;
520 for (int i = end+1; i < name.Length; ++i) {
521 switch (name [i]) {
522 case '{':
523 if (start != -1)
524 throw new ArgumentException (
525 string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
526 "prototype");
527 start = i+1;
528 break;
529 case '}':
530 if (start == -1)
531 throw new ArgumentException (
532 string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
533 "prototype");
534 seps.Add (name.Substring (start, i-start));
535 start = -1;
536 break;
537 default:
538 if (start == -1)
539 seps.Add (name [i].ToString ());
540 break;
541 }
542 }
543 if (start != -1)
544 throw new ArgumentException (
545 string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
546 "prototype");
547 }
548
549 public void Invoke (OptionContext c)
550 {

Callers

nothing calls this directly

Calls 3

FormatMethod · 0.80
AddMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected