winget-cli

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

SettingsCommand.h (2579B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include "Command.h"
      5 
      6 namespace AppInstaller::CLI
      7 {
      8     struct SettingsCommand final : public Command
      9     {
     10         SettingsCommand(std::string_view parent) : Command("settings", { "config" }, parent, Settings::TogglePolicy::Policy::Settings) {}
     11 
     12         std::vector<std::unique_ptr<Command>> GetCommands() const override;
     13         std::vector<Argument> GetArguments() const override;
     14 
     15         virtual Resource::LocString ShortDescription() const override;
     16         virtual Resource::LocString LongDescription() const override;
     17 
     18         Utility::LocIndView HelpLink() const override;
     19 
     20     protected:
     21         void ValidateArgumentsInternal(Execution::Args& execArgs) const override;
     22         void ExecuteInternal(Execution::Context& context) const override;
     23     };
     24 
     25     struct SettingsExportCommand final : public Command
     26     {
     27         SettingsExportCommand(std::string_view parent) : Command("export", parent, CommandOutputFlags::IgnoreSettingsWarnings) {}
     28 
     29         Resource::LocString ShortDescription() const override;
     30         Resource::LocString LongDescription() const override;
     31 
     32         Utility::LocIndView HelpLink() const override;
     33 
     34     protected:
     35         void ExecuteInternal(Execution::Context& context) const override;
     36     };
     37 
     38     struct SettingsSetCommand final : public Command
     39     {
     40         SettingsSetCommand(std::string_view parent) : Command("set", {}, parent, Settings::TogglePolicy::Policy::Settings) {}
     41 
     42         std::vector<Argument> GetArguments() const override;
     43 
     44         virtual Resource::LocString ShortDescription() const override;
     45         virtual Resource::LocString LongDescription() const override;
     46 
     47         Utility::LocIndView HelpLink() const override;
     48 
     49     protected:
     50         void ValidateArgumentsInternal(Execution::Args& execArgs) const override;
     51         void ExecuteInternal(Execution::Context& context) const override;
     52     };
     53 
     54     struct SettingsResetCommand final : public Command
     55     {
     56         SettingsResetCommand(std::string_view parent) : Command("reset", {}, parent, Settings::TogglePolicy::Policy::Settings) {}
     57 
     58         std::vector<Argument> GetArguments() const override;
     59 
     60         virtual Resource::LocString ShortDescription() const override;
     61         virtual Resource::LocString LongDescription() const override;
     62 
     63         Utility::LocIndView HelpLink() const override;
     64 
     65     protected:
     66         void ValidateArgumentsInternal(Execution::Args& execArgs) const override;
     67         void ExecuteInternal(Execution::Context& context) const override;
     68     };
     69 }