| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | RegistryCommand.h |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | Declaration of the registry command tree (login, logout). |
| 12 | |
| 13 | --*/ |
| 14 | #pragma once |
| 15 | #include "Command.h" |
| 16 | |
| 17 | namespace wsl::windows::wslc { |
| 18 | |
| 19 | // Root registry command: wslc registry [login|logout] |
| 20 | struct RegistryCommand final : public Command |
| 21 | { |
| 22 | constexpr static std::wstring_view CommandName = L"registry"; |
| 23 | RegistryCommand(const std::wstring& parent) : Command(CommandName, parent) |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | std::vector<std::unique_ptr<Command>> GetCommands() const override; |
| 28 | std::vector<Argument> GetArguments() const override; |
| 29 | std::wstring ShortDescription() const override; |
| 30 | std::wstring LongDescription() const override; |
| 31 | |
| 32 | protected: |
| 33 | void ExecuteInternal(CLIExecutionContext& context) const override; |
| 34 | }; |
| 35 | |
| 36 | // Login Command |
| 37 | struct RegistryLoginCommand final : public Command |
| 38 | { |
| 39 | constexpr static std::wstring_view CommandName = L"login"; |
| 40 | |
| 41 | RegistryLoginCommand(const std::wstring& parent) : Command(CommandName, parent) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | std::vector<Argument> GetArguments() const override; |
| 46 | std::wstring ShortDescription() const override; |
| 47 | std::wstring LongDescription() const override; |
| 48 | |
| 49 | protected: |
| 50 | void ValidateArgumentsInternal(ArgMap& execArgs) const override; |
| 51 | void ExecuteInternal(CLIExecutionContext& context) const override; |
| 52 | }; |
| 53 | |
| 54 | // Logout Command |
| 55 | struct RegistryLogoutCommand final : public Command |
| 56 | { |
| 57 | constexpr static std::wstring_view CommandName = L"logout"; |
| 58 | |
| 59 | RegistryLogoutCommand(const std::wstring& parent) : Command(CommandName, parent) |
| 60 | { |
| 61 | } |
| 62 | |
| 63 | std::vector<Argument> GetArguments() const override; |
| 64 | std::wstring ShortDescription() const override; |
| 65 | std::wstring LongDescription() const override; |
| 66 | |
| 67 | protected: |
| 68 | void ExecuteInternal(CLIExecutionContext& context) const override; |
| 69 | }; |
| 70 | |
| 71 | } // namespace wsl::windows::wslc |