com.rusanu.DBUtil.SqlCmd.ShellCommand C# (CSharp) Method

ShellCommand() private method

private ShellCommand ( string line ) : void
line string
return void
		private void ShellCommand (string line) {
			var regShell = new Regex (@":!!\s+(?<command>""[^""]+""|[^\s]+)(?:\s+(?<arguments>.+))?", RegexOptions.IgnoreCase);
			MatchCollection matchShell = regShell.Matches (line);

			Debug.Assert (1 == matchShell.Count);
			Match m = matchShell [0];

			Group commandGroup = m.Groups ["command"];
			if (false == commandGroup.Success) {
				throw new SqlCmdShellSyntaxException (line);
			}

			Group argsGroup = m.Groups ["arguments"];

			Process.Start (commandGroup.Value, argsGroup.Value);
		}