about summary refs log tree commit diff
path: root/pkgs/games/build-support/monogame-patcher/src/patcher.cs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/games/build-support/monogame-patcher/src/patcher.cs')
-rw-r--r--pkgs/games/build-support/monogame-patcher/src/patcher.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/games/build-support/monogame-patcher/src/patcher.cs b/pkgs/games/build-support/monogame-patcher/src/patcher.cs
index cac60250..b35e44d6 100644
--- a/pkgs/games/build-support/monogame-patcher/src/patcher.cs
+++ b/pkgs/games/build-support/monogame-patcher/src/patcher.cs
@@ -128,7 +128,17 @@ class ReplaceCall : Command {
 
 public class patcher {
     public static int Main(string[] args) {
-        Parser.Default.ParseArguments<FixFileStreamsCmd, ReplaceCallCmd>(args)
+        var parser = new Parser((settings) => {
+            settings.EnableDashDash = true;
+            settings.HelpWriter = Console.Error;
+
+            // XXX: When not running in a terminal the width is 0, but the
+            //      CommandLine library expects it to be greater than zero.
+            if (Console.WindowWidth == 0)
+                settings.MaximumDisplayWidth = 80;
+        });
+
+        parser.ParseArguments<FixFileStreamsCmd, ReplaceCallCmd>(args)
             .WithParsed<FixFileStreamsCmd>(opts => new FixFileStreams(opts))
             .WithParsed<ReplaceCallCmd>(opts => new ReplaceCall(opts));
         return 0;