winget-cli

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

PinCommand.h (3049B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include "Command.h"
      5 #include <winget/UserSettings.h>
      6 
      7 namespace AppInstaller::CLI
      8 {
      9     struct PinCommand final : public Command
     10     {
     11         PinCommand(std::string_view parent) : Command("pin", {} /* aliases */, parent) {}
     12 
     13         std::vector<std::unique_ptr<Command>> GetCommands() const override;
     14 
     15         Resource::LocString ShortDescription() const override;
     16         Resource::LocString LongDescription() const override;
     17 
     18         Utility::LocIndView HelpLink() const override;
     19 
     20     protected:
     21         void ExecuteInternal(Execution::Context& context) const override;
     22     };
     23 
     24     struct PinAddCommand final : public Command
     25     {
     26         PinAddCommand(std::string_view parent) : Command("add", parent) {}
     27 
     28         std::vector<Argument> GetArguments() const override;
     29 
     30         Resource::LocString ShortDescription() const override;
     31         Resource::LocString LongDescription() const override;
     32 
     33         void Complete(Execution::Context& context, Execution::Args::Type valueType) const override;
     34 
     35         Utility::LocIndView HelpLink() const override;
     36 
     37     protected:
     38         void ValidateArgumentsInternal(Execution::Args& execArgs) const override;
     39         void ExecuteInternal(Execution::Context& context) const override;
     40     };
     41 
     42     struct PinRemoveCommand final : public Command
     43     {
     44         PinRemoveCommand(std::string_view parent) : Command("remove", parent) {}
     45 
     46         std::vector<Argument> GetArguments() const override;
     47 
     48         Resource::LocString ShortDescription() const override;
     49         Resource::LocString LongDescription() const override;
     50 
     51         void Complete(Execution::Context& context, Execution::Args::Type valueType) const override;
     52 
     53         Utility::LocIndView HelpLink() const override;
     54 
     55     protected:
     56         void ExecuteInternal(Execution::Context& context) const override;
     57     };
     58 
     59     struct PinListCommand final : public Command
     60     {
     61         PinListCommand(std::string_view parent) : Command("list", parent) {}
     62 
     63         std::vector<Argument> GetArguments() const override;
     64 
     65         Resource::LocString ShortDescription() const override;
     66         Resource::LocString LongDescription() const override;
     67 
     68         void Complete(Execution::Context& context, Execution::Args::Type valueType) const override;
     69 
     70         Utility::LocIndView HelpLink() const override;
     71 
     72     protected:
     73         void ExecuteInternal(Execution::Context& context) const override;
     74     };
     75 
     76     struct PinResetCommand final : public Command
     77     {
     78         PinResetCommand(std::string_view parent) : Command("reset", parent) {}
     79 
     80         std::vector<Argument> GetArguments() const override;
     81 
     82         Resource::LocString ShortDescription() const override;
     83         Resource::LocString LongDescription() const override;
     84 
     85         Utility::LocIndView HelpLink() const override;
     86 
     87     protected:
     88         void ExecuteInternal(Execution::Context& context) const override;
     89     };
     90 }