mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Fix GDPR questions and first configuration when the first invocation is calling a command.
This commit is contained in:
@@ -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<string> arguments)
|
||||
{
|
||||
List<string> extra = Options.Parse(arguments);
|
||||
|
||||
if(showHelp)
|
||||
if(!autoCall)
|
||||
{
|
||||
Options.WriteOptionDescriptions(CommandSet.Out);
|
||||
return (int)ErrorNumber.HelpRequested;
|
||||
}
|
||||
List<string> 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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user