winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

ConfigureValidateCommand.cpp (2169B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #include "pch.h"
      4 #include "ConfigureValidateCommand.h"
      5 #include "Workflows/ConfigurationFlow.h"
      6 #include "Workflows/MSStoreInstallerHandler.h"
      7 #include "ConfigurationCommon.h"
      8 
      9 using namespace AppInstaller::CLI::Workflow;
     10 
     11 namespace AppInstaller::CLI
     12 {
     13     std::vector<Argument> ConfigureValidateCommand::GetArguments() const
     14     {
     15         return {
     16             Argument{ Execution::Args::Type::ConfigurationFile, Resource::String::ConfigurationFileArgumentDescription, ArgumentType::Positional, true },
     17             Argument{ Execution::Args::Type::ConfigurationModulePath, Resource::String::ConfigurationModulePath, ArgumentType::Positional },
     18             Argument{ Execution::Args::Type::ConfigurationProcessorPath, Resource::String::ConfigurationProcessorPath, ArgumentType::Standard, Argument::Visibility::Help },
     19         };
     20     }
     21 
     22     Resource::LocString ConfigureValidateCommand::ShortDescription() const
     23     {
     24         return { Resource::String::ConfigureValidateCommandShortDescription };
     25     }
     26 
     27     Resource::LocString ConfigureValidateCommand::LongDescription() const
     28     {
     29         return { Resource::String::ConfigureValidateCommandLongDescription };
     30     }
     31 
     32     Utility::LocIndView ConfigureValidateCommand::HelpLink() const
     33     {
     34         return "https://aka.ms/winget-command-configure#validate"_liv;
     35     }
     36 
     37     void ConfigureValidateCommand::ExecuteInternal(Execution::Context& context) const
     38     {
     39         context <<
     40             VerifyIsFullPackage <<
     41             VerifyFileOrUri(Execution::Args::Type::ConfigurationFile) <<
     42             CreateConfigurationProcessorWithoutFactory <<
     43             OpenConfigurationSet <<
     44             CreateConfigurationProcessor <<
     45             ValidateConfigurationSetSemantics <<
     46             ValidateConfigurationSetUnitProcessors <<
     47             ValidateConfigurationSetUnitContents <<
     48             ValidateAllGoodMessage;
     49     }
     50 
     51     void ConfigureValidateCommand::ValidateArgumentsInternal(Execution::Args& execArgs) const
     52     {
     53         Configuration::ValidateCommonArguments(execArgs);
     54     }
     55 }