Browse Source

Improved help text and output errors to stderr

Addressed review comments from JustAMan.
PloughPuff 6 years ago
parent
commit
b5e8cce4cf
2 changed files with 6 additions and 9 deletions
  1. 1 4
      Jellyfin.Server/Program.cs
  2. 5 5
      Jellyfin.Server/StartupOptions.cs

+ 1 - 4
Jellyfin.Server/Program.cs

@@ -49,11 +49,8 @@ namespace Jellyfin.Server
                 args[i] = regex.Replace(args[i], substitution);
                 args[i] = regex.Replace(args[i], substitution);
             }
             }
 
 
-            // For CommandLine package, change default behaviour to output errors to stdout (instead of stderr)
-            var parser = new Parser(config => config.HelpWriter = Console.Out);
-
             // Parse the command line arguments and either start the app or exit indicating error
             // Parse the command line arguments and either start the app or exit indicating error
-            await parser.ParseArguments<StartupOptions>(args)
+            await Parser.Default.ParseArguments<StartupOptions>(args)
                 .MapResult(
                 .MapResult(
                     options => StartApp(options),
                     options => StartApp(options),
                     errs => Task.FromResult(0)).ConfigureAwait(false);
                     errs => Task.FromResult(0)).ConfigureAwait(false);

+ 5 - 5
Jellyfin.Server/StartupOptions.cs

@@ -8,19 +8,19 @@ namespace Jellyfin.Server
     /// </summary>
     /// </summary>
     public class StartupOptions : IStartupOptions
     public class StartupOptions : IStartupOptions
     {
     {
-        [Option('d', "datadir", Required = false, HelpText = "Path to use for the data folder (databases files etc.).")]
+        [Option('d', "datadir", Required = false, HelpText = "Path to use for the data folder (database files, etc.).")]
         public string DataDir { get; set; }
         public string DataDir { get; set; }
 
 
-        [Option('c', "configdir", Required = false, HelpText = "Path to use for config data (user policies and puctures).")]
+        [Option('c', "configdir", Required = false, HelpText = "Path to use for configuration data (user settings and pictures).")]
         public string ConfigDir { get; set; }
         public string ConfigDir { get; set; }
 
 
         [Option('l', "logdir", Required = false, HelpText = "Path to use for writing log files.")]
         [Option('l', "logdir", Required = false, HelpText = "Path to use for writing log files.")]
         public string LogDir { get; set; }
         public string LogDir { get; set; }
 
 
-        [Option("ffmpeg", Required = false, HelpText = "Path to external FFmpeg exe to use in place of built-in.")]
+        [Option("ffmpeg", Required = false, HelpText = "Path to external FFmpeg executable to use in place of default found in PATH. Must be specified along with --ffprobe.")]
         public string FFmpegPath { get; set; }
         public string FFmpegPath { get; set; }
 
 
-        [Option("ffprobe", Required = false, HelpText = "ffmpeg and ffprobe switches must be supplied together.")]
+        [Option("ffprobe", Required = false, HelpText = "Path to external FFprobe executable to use in place of default found in PATH. Must be specified along with --ffmpeg.")]
         public string FFprobePath { get; set; }
         public string FFprobePath { get; set; }
 
 
         [Option("service", Required = false, HelpText = "Run as headless service.")]
         [Option("service", Required = false, HelpText = "Run as headless service.")]
@@ -32,7 +32,7 @@ namespace Jellyfin.Server
         [Option("package-name", Required = false, HelpText = "Used when packaging Jellyfin (example, synology).")]
         [Option("package-name", Required = false, HelpText = "Used when packaging Jellyfin (example, synology).")]
         public string PackageName { get; set; }
         public string PackageName { get; set; }
 
 
-        [Option("restartpath", Required = false, HelpText = "Path to reset script.")]
+        [Option("restartpath", Required = false, HelpText = "Path to restart script.")]
         public string RestartPath { get; set; }
         public string RestartPath { get; set; }
 
 
         [Option("restartargs", Required = false, HelpText = "Arguments for restart script.")]
         [Option("restartargs", Required = false, HelpText = "Arguments for restart script.")]