winget-cli

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

ConfigureShowCommand.cpp (2508B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #include "pch.h"
      4 #include "ConfigureShowCommand.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> ConfigureShowCommand::GetArguments() const
     14     {
     15         return {
     16             // Required for now, make exclusive when history implemented
     17             Argument{ Execution::Args::Type::ConfigurationFile, Resource::String::ConfigurationFileArgumentDescription, ArgumentType::Positional },
     18             Argument{ Execution::Args::Type::ConfigurationModulePath, Resource::String::ConfigurationModulePath, ArgumentType::Positional },
     19             Argument{ Execution::Args::Type::ConfigurationProcessorPath, Resource::String::ConfigurationProcessorPath, ArgumentType::Standard, Argument::Visibility::Help },
     20             Argument{ Execution::Args::Type::ConfigurationHistoryItem, Resource::String::ConfigurationHistoryItemArgumentDescription, ArgumentType::Standard, Argument::Visibility::Help },
     21         };
     22     }
     23 
     24     Resource::LocString ConfigureShowCommand::ShortDescription() const
     25     {
     26         return { Resource::String::ConfigureShowCommandShortDescription };
     27     }
     28 
     29     Resource::LocString ConfigureShowCommand::LongDescription() const
     30     {
     31         return { Resource::String::ConfigureShowCommandLongDescription };
     32     }
     33 
     34     Utility::LocIndView ConfigureShowCommand::HelpLink() const
     35     {
     36         return "https://aka.ms/winget-command-configure#show"_liv;
     37     }
     38 
     39     void ConfigureShowCommand::ExecuteInternal(Execution::Context& context) const
     40     {
     41         context <<
     42             VerifyIsFullPackage <<
     43             VerifyFileOrUri(Execution::Args::Type::ConfigurationFile) <<
     44             CreateConfigurationProcessorWithoutFactory <<
     45             OpenConfigurationSet <<
     46             CreateConfigurationProcessor <<
     47             ShowConfigurationSet;
     48     }
     49 
     50     void ConfigureShowCommand::ValidateArgumentsInternal(Execution::Args& execArgs) const
     51     {
     52         Configuration::ValidateCommonArguments(execArgs, true);
     53     }
     54 
     55     void ConfigureShowCommand::Complete(Execution::Context& context, Execution::Args::Type argType) const
     56     {
     57         if (argType == Execution::Args::Type::ConfigurationHistoryItem)
     58         {
     59             context << CompleteConfigurationHistoryItem;
     60         }
     61     }
     62 }