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