master
cpp 52 lines 1.18 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft. All rights reserved.
4
5 Module Name:
6
7 VolumeCreateCommand.cpp
8
9 Abstract:
10
11 Implementation of command execution logic.
12
13 --*/
14
15 #include "VolumeCommand.h"
16 #include "CLIExecutionContext.h"
17 #include "SessionTasks.h"
18 #include "VolumeTasks.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 // Volume Create Command
27 std::vector<Argument> VolumeCreateCommand::GetArguments() const
28 {
29 return {
30 Argument::Create(ArgType::VolumeName),
31 Argument::Create(ArgType::Driver),
32 Argument::Create(ArgType::Options, {.Limit = Limit::Unlimited}),
33 Argument::Create(ArgType::Label, {.Limit = Limit::Unlimited}),
34 };
35 }
36
37 std::wstring VolumeCreateCommand::ShortDescription() const
38 {
39 return Localization::WSLCCLI_VolumeCreateDesc();
40 }
41
42 std::wstring VolumeCreateCommand::LongDescription() const
43 {
44 return Localization::WSLCCLI_VolumeCreateLongDesc();
45 }
46
47 void VolumeCreateCommand::ExecuteInternal(CLIExecutionContext& context) const
48 {
49 context << ResolveSession //
50 << CreateVolume;
51 }
52 } // namespace wsl::windows::wslc