-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathContainerCreateCommand.cpp
More file actions
79 lines (67 loc) · 2.28 KB
/
ContainerCreateCommand.cpp
File metadata and controls
79 lines (67 loc) · 2.28 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*++
Copyright (c) Microsoft. All rights reserved.
Module Name:
ContainerCreateCommand.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 Create Command
std::vector<Argument> ContainerCreateCommand::GetArguments() const
{
// clang-format off
return {
Argument::Create(ArgType::ImageId, true),
Argument::Create(ArgType::Command),
Argument::Create(ArgType::ForwardArgs),
Argument::Create(ArgType::CIDFile),
// Argument::Create(ArgType::DNS),
// Argument::Create(ArgType::DNSDomain),
// Argument::Create(ArgType::DNSOption),
// Argument::Create(ArgType::DNSSearch),
Argument::Create(ArgType::Entrypoint),
Argument::Create(ArgType::Env, false, NO_LIMIT),
Argument::Create(ArgType::EnvFile, false, NO_LIMIT),
// Argument::Create(ArgType::GroupId),
Argument::Create(ArgType::Interactive),
Argument::Create(ArgType::Name),
// Argument::Create(ArgType::NoDNS),
// Argument::Create(ArgType::Progress),
Argument::Create(ArgType::Publish, false, NO_LIMIT),
Argument::Create(ArgType::Remove),
// Argument::Create(ArgType::Scheme),
Argument::Create(ArgType::Session),
Argument::Create(ArgType::TMPFS, false, NO_LIMIT),
Argument::Create(ArgType::TTY),
Argument::Create(ArgType::User),
Argument::Create(ArgType::Volume, false, NO_LIMIT),
// Argument::Create(ArgType::Virtual),
};
// clang-format on
}
std::wstring ContainerCreateCommand::ShortDescription() const
{
return Localization::WSLCCLI_ContainerCreateDesc();
}
std::wstring ContainerCreateCommand::LongDescription() const
{
return Localization::WSLCCLI_ContainerCreateLongDesc();
}
// clang-format off
void ContainerCreateCommand::ExecuteInternal(CLIExecutionContext& context) const
{
context
<< CreateSession
<< SetContainerOptionsFromArgs
<< CreateContainer;
}
// clang-format on
} // namespace wsl::windows::wslc