| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | NetworkRemoveCommand.cpp |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | Implementation of command execution logic. |
| 12 | |
| 13 | --*/ |
| 14 | |
| 15 | #include "NetworkCommand.h" |
| 16 | #include "CLIExecutionContext.h" |
| 17 | #include "SessionTasks.h" |
| 18 | #include "NetworkTasks.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 | // Network Remove Command |
| 27 | std::vector<Argument> NetworkRemoveCommand::GetArguments() const |
| 28 | { |
| 29 | return { |
| 30 | Argument::Create(ArgType::NetworkName, {.Required = true, .Limit = Limit::Unlimited}), |
| 31 | Argument::Create(ArgType::Force, {.Desc = Localization::WSLCCLI_NetworkForceArgDescription()}), |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | std::wstring NetworkRemoveCommand::ShortDescription() const |
| 36 | { |
| 37 | return Localization::WSLCCLI_NetworkRemoveDesc(); |
| 38 | } |
| 39 | |
| 40 | std::wstring NetworkRemoveCommand::LongDescription() const |
| 41 | { |
| 42 | return Localization::WSLCCLI_NetworkRemoveLongDesc(); |
| 43 | } |
| 44 | |
| 45 | void NetworkRemoveCommand::ExecuteInternal(CLIExecutionContext& context) const |
| 46 | { |
| 47 | context << ResolveSession // |
| 48 | << DeleteNetworks; |
| 49 | } |
| 50 | } // namespace wsl::windows::wslc |