master
cpp 62 lines 1.7 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft. All rights reserved.
4
5 Module Name:
6
7 ImageBuildCommand.cpp
8
9 Abstract:
10
11 Implementation of command execution logic.
12
13 --*/
14
15 #include "ImageCommand.h"
16 #include "CLIExecutionContext.h"
17 #include "ImageTasks.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 // Image Build Command
27 std::vector<Argument> ImageBuildCommand::GetArguments() const
28 {
29 return {
30 Argument::Create(ArgType::Path, {.Required = true}),
31 Argument::Create(ArgType::BuildArg, {.Limit = Limit::Unlimited}),
32 Argument::Create(ArgType::BuildPull),
33 Argument::Create(ArgType::BuildTarget),
34 Argument::Create(ArgType::File),
35 Argument::Create(ArgType::IidFile),
36 Argument::Create(ArgType::BuildLabel, {.Limit = Limit::Unlimited}),
37 Argument::Create(ArgType::NoCache),
38 Argument::Create(ArgType::BuildOutput, {.Desc = Localization::WSLCCLI_BuildOutputArgDescription()}),
39 Argument::Create(ArgType::Progress),
40 Argument::Create(ArgType::Secret, {.Limit = Limit::Unlimited}),
41 Argument::Create(ArgType::Tag, {.Limit = Limit::Unlimited}),
42 Argument::Create(ArgType::Verbose),
43 };
44 }
45
46 std::wstring ImageBuildCommand::ShortDescription() const
47 {
48 return Localization::WSLCCLI_ImageBuildDesc();
49 }
50
51 std::wstring ImageBuildCommand::LongDescription() const
52 {
53 return Localization::WSLCCLI_ImageBuildLongDesc();
54 }
55
56 void ImageBuildCommand::ExecuteInternal(CLIExecutionContext& context) const
57 {
58 context //
59 << ResolveSession //
60 << BuildImage;
61 }
62 } // namespace wsl::windows::wslc