diff --git a/DiscImageChef/Commands/Configure.cs b/DiscImageChef/Commands/Configure.cs index bf0a3b8e9..8edb25d8c 100644 --- a/DiscImageChef/Commands/Configure.cs +++ b/DiscImageChef/Commands/Configure.cs @@ -42,11 +42,14 @@ namespace DiscImageChef.Commands class ConfigureCommand : Command { readonly bool gdprChange; + bool autoCall; bool showHelp; - public ConfigureCommand(bool gdprChange) : base("configure", "Configures user settings and statistics.") + public ConfigureCommand(bool gdprChange, bool autoCall) : base("configure", + "Configures user settings and statistics.") { this.gdprChange = gdprChange; + this.autoCall = autoCall; Options = new OptionSet { $"{MainClass.AssemblyTitle} {MainClass.AssemblyVersion?.InformationalVersion}", @@ -61,22 +64,25 @@ namespace DiscImageChef.Commands public override int Invoke(IEnumerable arguments) { - List extra = Options.Parse(arguments); - - if(showHelp) + if(!autoCall) { - Options.WriteOptionDescriptions(CommandSet.Out); - return (int)ErrorNumber.HelpRequested; - } + List extra = Options.Parse(arguments); - MainClass.PrintCopyright(); - if(MainClass.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; - if(MainClass.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; + if(showHelp) + { + Options.WriteOptionDescriptions(CommandSet.Out); + return (int)ErrorNumber.HelpRequested; + } - if(extra.Count != 0) - { - DicConsole.ErrorWriteLine("Too many arguments."); - return (int)ErrorNumber.UnexpectedArgumentCount; + MainClass.PrintCopyright(); + if(MainClass.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; + if(MainClass.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; + + if(extra.Count != 0) + { + DicConsole.ErrorWriteLine("Too many arguments."); + return (int)ErrorNumber.UnexpectedArgumentCount; + } } if(gdprChange) diff --git a/DiscImageChef/Main.cs b/DiscImageChef/Main.cs index 306d82d25..eba7212e2 100644 --- a/DiscImageChef/Main.cs +++ b/DiscImageChef/Main.cs @@ -79,7 +79,7 @@ namespace DiscImageChef if(!File.Exists(Settings.Settings.MasterDbPath)) { masterDbUpdate = true; - UpdateCommand.DoUpdate(masterDbUpdate); + UpdateCommand.DoUpdate(true); } DicContext mctx = DicContext.Create(Settings.Settings.MasterDbPath); @@ -88,7 +88,7 @@ namespace DiscImageChef if((args.Length < 1 || args[0].ToLowerInvariant() != "gui") && Settings.Settings.Current.GdprCompliance < DicSettings.GdprLevel) - new ConfigureCommand(true).Invoke(args); + new ConfigureCommand(true, true).Invoke(args); Statistics.LoadStats(); if(Settings.Settings.Current.Stats != null && Settings.Settings.Current.Stats.ShareStats) Task.Run(() => { Statistics.SubmitStats(); }); @@ -111,7 +111,7 @@ namespace DiscImageChef new BenchmarkCommand(), new ChecksumCommand(), new CompareCommand(), - new ConfigureCommand(false), + new ConfigureCommand(false, false), new ConvertImageCommand(), new CreateSidecarCommand(), new DecodeCommand()