master
h 109 lines 3.12 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft. All rights reserved.
4
5 Module Name:
6
7 VolumeCommand.h
8
9 Abstract:
10
11 Declaration of command classes and interfaces.
12
13 --*/
14 #pragma once
15 #include "Command.h"
16
17 namespace wsl::windows::wslc {
18 // Root Volume Command
19 struct VolumeCommand final : public Command
20 {
21 constexpr static std::wstring_view CommandName = L"volume";
22 VolumeCommand(const std::wstring& parent) : Command(CommandName, parent)
23 {
24 }
25 std::vector<Argument> GetArguments() const override;
26 std::wstring ShortDescription() const override;
27 std::wstring LongDescription() const override;
28
29 std::vector<std::unique_ptr<Command>> GetCommands() const override;
30
31 protected:
32 void ExecuteInternal(CLIExecutionContext& context) const override;
33 };
34
35 // Create Command
36 struct VolumeCreateCommand final : public Command
37 {
38 constexpr static std::wstring_view CommandName = L"create";
39 VolumeCreateCommand(const std::wstring& parent) : Command(CommandName, parent)
40 {
41 }
42 std::vector<Argument> GetArguments() const override;
43 std::wstring ShortDescription() const override;
44 std::wstring LongDescription() const override;
45
46 protected:
47 void ExecuteInternal(CLIExecutionContext& context) const override;
48 };
49
50 // Remove Command
51 struct VolumeRemoveCommand final : public Command
52 {
53 constexpr static std::wstring_view CommandName = L"remove";
54 VolumeRemoveCommand(const std::wstring& parent) : Command(CommandName, {L"delete", L"rm"}, parent)
55 {
56 }
57 std::vector<Argument> GetArguments() const override;
58 std::wstring ShortDescription() const override;
59 std::wstring LongDescription() const override;
60
61 protected:
62 void ExecuteInternal(CLIExecutionContext& context) const override;
63 };
64
65 // Inspect Command
66 struct VolumeInspectCommand final : public Command
67 {
68 constexpr static std::wstring_view CommandName = L"inspect";
69 VolumeInspectCommand(const std::wstring& parent) : Command(CommandName, parent)
70 {
71 }
72 std::vector<Argument> GetArguments() const override;
73 std::wstring ShortDescription() const override;
74 std::wstring LongDescription() const override;
75
76 protected:
77 void ExecuteInternal(CLIExecutionContext& context) const override;
78 };
79
80 // List Command
81 struct VolumeListCommand final : public Command
82 {
83 constexpr static std::wstring_view CommandName = L"list";
84 VolumeListCommand(const std::wstring& parent) : Command(CommandName, {L"ls"}, parent)
85 {
86 }
87 std::vector<Argument> GetArguments() const override;
88 std::wstring ShortDescription() const override;
89 std::wstring LongDescription() const override;
90
91 protected:
92 void ExecuteInternal(CLIExecutionContext& context) const override;
93 };
94
95 // Prune Command
96 struct VolumePruneCommand final : public Command
97 {
98 constexpr static std::wstring_view CommandName = L"prune";
99 VolumePruneCommand(const std::wstring& parent) : Command(CommandName, parent)
100 {
101 }
102 std::vector<Argument> GetArguments() const override;
103 std::wstring ShortDescription() const override;
104 std::wstring LongDescription() const override;
105
106 protected:
107 void ExecuteInternal(CLIExecutionContext& context) const override;
108 };
109 } // namespace wsl::windows::wslc