-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathContainerExecCommand.cpp
More file actions
62 lines (51 loc) · 1.64 KB
/
ContainerExecCommand.cpp
File metadata and controls
62 lines (51 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
ContainerExecCommand.cpp
Abstract:
Implementation of command execution logic.
--*/
#include "ContainerCommand.h"
#include "CLIExecutionContext.h"
#include "ContainerTasks.h"
#include "SessionTasks.h"
#include "Task.h"
using namespace wsl::windows::wslc::execution;
using namespace wsl::windows::wslc::task;
using namespace wsl::shared;
namespace wsl::windows::wslc {
// Container Exec Command
std::vector<Argument> ContainerExecCommand::GetArguments() const
{
return {
Argument::Create(ArgType::ContainerId, true),
Argument::Create(ArgType::Command, true),
Argument::Create(ArgType::ForwardArgs, std::nullopt, std::nullopt, Localization::WSLCCLI_ContainerExecForwardArgsDescription()),
Argument::Create(ArgType::Detach),
Argument::Create(ArgType::Env, false, NO_LIMIT),
Argument::Create(ArgType::EnvFile, false, NO_LIMIT),
Argument::Create(ArgType::Interactive),
Argument::Create(ArgType::Session),
Argument::Create(ArgType::TTY),
Argument::Create(ArgType::User),
Argument::Create(ArgType::WorkDir),
};
}
std::wstring ContainerExecCommand::ShortDescription() const
{
return Localization::WSLCCLI_ContainerExecDesc();
}
std::wstring ContainerExecCommand::LongDescription() const
{
return Localization::WSLCCLI_ContainerExecLongDesc();
}
// clang-format off
void ContainerExecCommand::ExecuteInternal(CLIExecutionContext& context) const
{
context
<< CreateSession
<< SetContainerOptionsFromArgs
<< ExecContainer;
}
// clang-format on
} // namespace wsl::windows::wslc