master
cpp 52 lines 1.17 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft. All rights reserved.
4
5 Module Name:
6
7 VolumeListCommand.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 List Command
27 std::vector<Argument> VolumeListCommand::GetArguments() const
28 {
29 return {
30 Argument::Create(ArgType::Filter, {.Limit = Limit::Unlimited}),
31 Argument::Create(ArgType::Format),
32 Argument::Create(ArgType::Quiet, {.Desc = Localization::WSLCCLI_VolumeListQuietArgDesc()}),
33 };
34 }
35
36 std::wstring VolumeListCommand::ShortDescription() const
37 {
38 return Localization::WSLCCLI_VolumeListDesc();
39 }
40
41 std::wstring VolumeListCommand::LongDescription() const
42 {
43 return Localization::WSLCCLI_VolumeListLongDesc();
44 }
45
46 void VolumeListCommand::ExecuteInternal(CLIExecutionContext& context) const
47 {
48 context << ResolveSession //
49 << GetVolumes //
50 << ListVolumes;
51 }
52 } // namespace wsl::windows::wslc