diff --git a/CHANGELIST.md b/CHANGELIST.md index 2b47d6c8..d275b2a6 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -18,6 +18,7 @@ - Remove CommandOptions implementations - Exit early on parsing failures - Fix minor typo in verify inputs check +- Allow but do not require config for Check ### 3.4.2 (2025-09-30) diff --git a/MPF.CLI/Features/InteractiveFeature.cs b/MPF.CLI/Features/InteractiveFeature.cs index b2581d26..e1536fd3 100644 --- a/MPF.CLI/Features/InteractiveFeature.cs +++ b/MPF.CLI/Features/InteractiveFeature.cs @@ -22,7 +22,6 @@ namespace MPF.CLI.Features public InteractiveFeature() : base(DisplayName, _flags, _description) { - Options = OptionsLoader.LoadFromConfig(); } /// @@ -34,6 +33,9 @@ namespace MPF.CLI.Features Inputs.Add(args[i]); } + // Read the options from config, if possible + Options = OptionsLoader.LoadFromConfig(); + // Create return values MediaType = SabreTools.RedumpLib.Data.MediaType.NONE; FilePath = Path.Combine(Options.DefaultOutputPath ?? "ISO", "track.bin"); diff --git a/MPF.CLI/Features/MainFeature.cs b/MPF.CLI/Features/MainFeature.cs index 1f169ed0..04d71141 100644 --- a/MPF.CLI/Features/MainFeature.cs +++ b/MPF.CLI/Features/MainFeature.cs @@ -48,33 +48,6 @@ namespace MPF.CLI.Features public MainFeature() : base(DisplayName, _flags, _description) { - Options = new Options() - { - // Internal Program - InternalProgram = InternalProgram.NONE, - - // Extra Dumping Options - ScanForProtection = false, - AddPlaceholders = true, - PullAllInformation = false, - AddFilenameSuffix = false, - OutputSubmissionJSON = false, - IncludeArtifacts = false, - CompressLogFiles = false, - DeleteUnnecessaryFiles = false, - CreateIRDAfterDumping = false, - - // Protection Scanning Options - ScanArchivesForProtection = true, - IncludeDebugProtectionInformation = false, - HideDriveLetters = false, - - // Redump Login Information - RetrieveMatchInformation = true, - RedumpUsername = null, - RedumpPassword = null, - }; - Add(UseInput); Add(MediaTypeInput); Add(DeviceInput); @@ -91,6 +64,9 @@ namespace MPF.CLI.Features if (args == null || args.Length == 0) return true; + // Read the options from config, if possible + Options = OptionsLoader.LoadFromConfig(); + // The first argument is the system type System = args[0].Trim('"').ToRedumpSystem(); diff --git a/MPF.Check/Features/InteractiveFeature.cs b/MPF.Check/Features/InteractiveFeature.cs index 0a9dac46..5672fafa 100644 --- a/MPF.Check/Features/InteractiveFeature.cs +++ b/MPF.Check/Features/InteractiveFeature.cs @@ -1,6 +1,7 @@ using System; using MPF.Frontend; +using MPF.Frontend.Tools; using SabreTools.RedumpLib; using SabreTools.RedumpLib.Data; @@ -32,6 +33,38 @@ namespace MPF.Check.Features Inputs.Add(args[i]); } + // Read the options from config, if possible + Options = OptionsLoader.LoadFromConfig(); + if (Options.FirstRun) + { + Options = new Options() + { + // Internal Program + InternalProgram = InternalProgram.NONE, + + // Extra Dumping Options + ScanForProtection = false, + AddPlaceholders = true, + PullAllInformation = false, + AddFilenameSuffix = false, + OutputSubmissionJSON = false, + IncludeArtifacts = false, + CompressLogFiles = false, + DeleteUnnecessaryFiles = false, + CreateIRDAfterDumping = false, + + // Protection Scanning Options + ScanArchivesForProtection = true, + IncludeDebugProtectionInformation = false, + HideDriveLetters = false, + + // Redump Login Information + RetrieveMatchInformation = true, + RedumpUsername = null, + RedumpPassword = null, + }; + } + // Create return values System = null; diff --git a/MPF.Check/Features/MainFeature.cs b/MPF.Check/Features/MainFeature.cs index 2d15359c..e3fa47d1 100644 --- a/MPF.Check/Features/MainFeature.cs +++ b/MPF.Check/Features/MainFeature.cs @@ -1,4 +1,5 @@ using MPF.Frontend; +using MPF.Frontend.Tools; using SabreTools.CommandLine.Inputs; using SabreTools.RedumpLib; using SabreTools.RedumpLib.Data; @@ -74,33 +75,6 @@ namespace MPF.Check.Features public MainFeature() : base(DisplayName, _flags, _description) { - Options = new Options() - { - // Internal Program - InternalProgram = InternalProgram.NONE, - - // Extra Dumping Options - ScanForProtection = false, - AddPlaceholders = true, - PullAllInformation = false, - AddFilenameSuffix = false, - OutputSubmissionJSON = false, - IncludeArtifacts = false, - CompressLogFiles = false, - DeleteUnnecessaryFiles = false, - CreateIRDAfterDumping = false, - - // Protection Scanning Options - ScanArchivesForProtection = true, - IncludeDebugProtectionInformation = false, - HideDriveLetters = false, - - // Redump Login Information - RetrieveMatchInformation = true, - RedumpUsername = null, - RedumpPassword = null, - }; - Add(UseInput); Add(LoadSeedInput); Add(NoPlaceholdersInput); @@ -133,6 +107,38 @@ namespace MPF.Check.Features if (args == null || args.Length == 0) return true; + // Read the options from config, if possible + Options = OptionsLoader.LoadFromConfig(); + if (Options.FirstRun) + { + Options = new Options() + { + // Internal Program + InternalProgram = InternalProgram.NONE, + + // Extra Dumping Options + ScanForProtection = false, + AddPlaceholders = true, + PullAllInformation = false, + AddFilenameSuffix = false, + OutputSubmissionJSON = false, + IncludeArtifacts = false, + CompressLogFiles = false, + DeleteUnnecessaryFiles = false, + CreateIRDAfterDumping = false, + + // Protection Scanning Options + ScanArchivesForProtection = true, + IncludeDebugProtectionInformation = false, + HideDriveLetters = false, + + // Redump Login Information + RetrieveMatchInformation = true, + RedumpUsername = null, + RedumpPassword = null, + }; + } + // The first argument is the system type System = args[0].Trim('"').ToRedumpSystem();