diff --git a/src/Core/ServiceWrapper/Program.cs b/src/Core/ServiceWrapper/Program.cs index 1e5a259..96d5920 100644 --- a/src/Core/ServiceWrapper/Program.cs +++ b/src/Core/ServiceWrapper/Program.cs @@ -88,20 +88,7 @@ namespace winsw return; } - var args = new List(Array.AsReadOnly(argsArray)); - if (args[0] == "/redirect") - { - var f = new FileStream(args[1], FileMode.Create); - var w = new StreamWriter(f) { AutoFlush = true }; - Console.SetOut(w); - Console.SetError(w); - - var handle = f.SafeFileHandle; - _ = Kernel32.SetStdHandle(-11, handle); // set stdout - _ = Kernel32.SetStdHandle(-12, handle); // set stder - - args = args.GetRange(2, args.Count - 2); - } + var args = new List(argsArray); bool elevated; if (args[0] == "/elevated") @@ -692,9 +679,6 @@ namespace winsw Console.WriteLine(); PrintAvailableCommands(); Console.WriteLine(); - Console.WriteLine("Extra options:"); - Console.WriteLine(" /redirect redirect the wrapper's STDOUT and STDERR to the specified file"); - Console.WriteLine(); PrintVersion(); Console.WriteLine("More info: https://github.com/winsw/winsw"); Console.WriteLine("Bug tracker: https://github.com/winsw/winsw/issues"); diff --git a/src/Core/WinSWCore/Native/Kernel32.cs b/src/Core/WinSWCore/Native/Kernel32.cs deleted file mode 100755 index ba1afbb..0000000 --- a/src/Core/WinSWCore/Native/Kernel32.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -namespace winsw.Native -{ - internal static class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern bool SetStdHandle(int stdHandle, SafeFileHandle handle); - } -} diff --git a/src/Test/winswTests/MainTest.cs b/src/Test/winswTests/MainTest.cs index e434e3b..76fc3c8 100644 --- a/src/Test/winswTests/MainTest.cs +++ b/src/Test/winswTests/MainTest.cs @@ -51,9 +51,6 @@ namespace winswTests Assert.That(cliOut, Does.Contain("help")); Assert.That(cliOut, Does.Contain("version")); // TODO: check all commands after the migration of ccommands to enum - - // Extra options - Assert.That(cliOut, Does.Contain("/redirect")); } [Test]