From b5e8cce4cfb5356ca3f46d2cde66b5d0d4084f4d Mon Sep 17 00:00:00 2001 From: PloughPuff Date: Tue, 29 Jan 2019 13:34:59 +0000 Subject: [PATCH] Improved help text and output errors to stderr Addressed review comments from JustAMan. --- Jellyfin.Server/Program.cs | 5 +---- Jellyfin.Server/StartupOptions.cs | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 905cf3aa0d..2f18283360 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -49,11 +49,8 @@ namespace Jellyfin.Server 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 - await parser.ParseArguments(args) + await Parser.Default.ParseArguments(args) .MapResult( options => StartApp(options), errs => Task.FromResult(0)).ConfigureAwait(false); diff --git a/Jellyfin.Server/StartupOptions.cs b/Jellyfin.Server/StartupOptions.cs index a1bdb756ec..6e6b617251 100644 --- a/Jellyfin.Server/StartupOptions.cs +++ b/Jellyfin.Server/StartupOptions.cs @@ -8,19 +8,19 @@ namespace Jellyfin.Server /// 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; } - [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; } [Option('l', "logdir", Required = false, HelpText = "Path to use for writing log files.")] 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; } - [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; } [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).")] 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; } [Option("restartargs", Required = false, HelpText = "Arguments for restart script.")]