Skip to content

Utilities CommandLineSplitter

Adam Bajguz edited this page Apr 5, 2021 · 1 revision

In **Typin **arguments in both interactive and normal modes are split with CommandLineSplitter utility class. This ensures a consistent argument delimiting and escaping across all platforms. This class is also accessible to programmers as a public utility. It is based on a solution provided by Mikescher.

Example usage:

IEnumerable<string> split = CommandLineSplitter.Split(@"/src:""C:\tmp\Some Folder\Sub Folder"" /users:""abcdefg@hijkl.com"" tasks:""SomeTask,Some Other Task"" -someParam foo");

// split is an equivalent to: new[] { @"/src:C:\tmp\Some Folder\Sub Folder", @"/users:abcdefg@hijkl.com", @"tasks:SomeTask,Some Other Task", @"-someParam", @"foo" }
Clone this wiki locally