| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | ContainerRemoveCommand.cpp |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | Implementation of command execution logic. |
| 12 | |
| 13 | --*/ |
| 14 | |
| 15 | #include "ContainerCommand.h" |
| 16 | #include "CLIExecutionContext.h" |
| 17 | #include "ContainerTasks.h" |
| 18 | #include "SessionTasks.h" |
| 19 | #include "Task.h" |
| 20 | |
| 21 | using namespace wsl::windows::wslc::execution; |
| 22 | using namespace wsl::windows::wslc::task; |
| 23 | using namespace wsl::shared; |
| 24 | |
| 25 | namespace wsl::windows::wslc { |
| 26 | // Container Remove Command |
| 27 | std::vector<Argument> ContainerRemoveCommand::GetArguments() const |
| 28 | { |
| 29 | return { |
| 30 | Argument::Create(ArgType::ContainerId, {.Required = true, .Limit = Limit::Unlimited}), |
| 31 | Argument::Create(ArgType::Force), |
| 32 | Argument::Create(ArgType::Volumes), |
| 33 | }; |
| 34 | } |
| 35 | |
| 36 | std::wstring ContainerRemoveCommand::ShortDescription() const |
| 37 | { |
| 38 | return Localization::WSLCCLI_ContainerRemoveDesc(); |
| 39 | } |
| 40 | |
| 41 | std::wstring ContainerRemoveCommand::LongDescription() const |
| 42 | { |
| 43 | return Localization::WSLCCLI_ContainerRemoveLongDesc(); |
| 44 | } |
| 45 | |
| 46 | void ContainerRemoveCommand::ExecuteInternal(CLIExecutionContext& context) const |
| 47 | { |
| 48 | context // |
| 49 | << ResolveSession // |
| 50 | << RemoveContainers; |
| 51 | } |
| 52 | } // namespace wsl::windows::wslc |