Skip to content

Commit 2eafe06

Browse files
committed
Add help text to cli commands
Signed-off-by: Guvenc Gulce <[email protected]>
1 parent 0106128 commit 2eafe06

File tree

3 files changed

+57
-21
lines changed

3 files changed

+57
-21
lines changed

cli/src/host_commands.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ pub struct HostArgs {
2525

2626
#[derive(Subcommand, Debug)]
2727
pub enum HostCommand {
28+
/// Get the host machine's hostname
2829
Hostname,
30+
/// Display detailed memory information from /proc/meminfo
2931
Memory,
32+
/// Display CPU information from /proc/cpuinfo
3033
CpuInfo,
34+
/// Display network interface statistics
3135
NetworkInfo,
36+
/// Upgrade the FeOS binary from a remote URL
3237
Upgrade {
3338
#[arg(long, required = true, help = "URL to fetch the new FeOS binary from")]
3439
url: String,

cli/src/image_commands.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,24 @@ pub struct ImageArgs {
2727

2828
#[derive(Subcommand, Debug)]
2929
pub enum ImageCommand {
30+
/// Pull a container image from a registry
3031
Pull {
31-
#[arg(required = true)]
32+
#[arg(
33+
required = true,
34+
help = "Container image reference to pull (e.g., docker.io/library/ubuntu:latest)"
35+
)]
3236
image_ref: String,
3337
},
38+
/// List all local container images
3439
List,
40+
/// Watch the status of an image pull operation
3541
Watch {
36-
#[arg(required = true)]
42+
#[arg(required = true, help = "UUID of the image to watch")]
3743
image_uuid: String,
3844
},
45+
/// Delete a local container image
3946
Delete {
40-
#[arg(required = true)]
47+
#[arg(required = true, help = "UUID of the image to delete")]
4148
image_uuid: String,
4249
},
4350
}

cli/src/vm_commands.rs

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,22 @@ pub struct VmArgs {
3333

3434
#[derive(Subcommand, Debug)]
3535
pub enum VmCommand {
36+
/// Create a new virtual machine with specified configuration
3637
Create {
37-
#[arg(long, required = true)]
38+
#[arg(
39+
long,
40+
required = true,
41+
help = "Container image reference to use for the VM"
42+
)]
3843
image_ref: String,
3944

40-
#[arg(long, default_value_t = 1)]
45+
#[arg(long, default_value_t = 1, help = "Number of virtual CPUs to allocate")]
4146
vcpus: u32,
4247

43-
#[arg(long, default_value_t = 1024)]
48+
#[arg(long, default_value_t = 1024, help = "Memory size in MiB")]
4449
memory: u64,
4550

46-
#[arg(long)]
51+
#[arg(long, help = "Optional custom VM identifier")]
4752
vm_id: Option<String>,
4853

4954
#[arg(
@@ -52,56 +57,75 @@ pub enum VmCommand {
5257
)]
5358
pci_device: Vec<String>,
5459

55-
#[arg(long)]
60+
#[arg(long, help = "Enable hugepages for memory allocation")]
5661
hugepages: bool,
5762
},
63+
/// Start an existing virtual machine
5864
Start {
59-
#[arg(required = true)]
65+
#[arg(required = true, help = "VM identifier")]
6066
vm_id: String,
6167
},
68+
/// Get detailed information about a virtual machine
6269
Info {
63-
#[arg(required = true)]
70+
#[arg(required = true, help = "VM identifier")]
6471
vm_id: String,
6572
},
73+
/// List all virtual machines
6674
List,
75+
/// Ping a virtual machine's VMM to check status
6776
Ping {
68-
#[arg(required = true)]
77+
#[arg(required = true, help = "VM identifier")]
6978
vm_id: String,
7079
},
80+
/// Gracefully shutdown a virtual machine
7181
Shutdown {
72-
#[arg(required = true)]
82+
#[arg(required = true, help = "VM identifier")]
7383
vm_id: String,
7484
},
85+
/// Pause a running virtual machine
7586
Pause {
76-
#[arg(required = true)]
87+
#[arg(required = true, help = "VM identifier")]
7788
vm_id: String,
7889
},
90+
/// Resume a paused virtual machine
7991
Resume {
80-
#[arg(required = true)]
92+
#[arg(required = true, help = "VM identifier")]
8193
vm_id: String,
8294
},
95+
/// Delete a virtual machine
8396
Delete {
84-
#[arg(required = true)]
97+
#[arg(required = true, help = "VM identifier")]
8598
vm_id: String,
8699
},
100+
/// Watch virtual machine state change events
87101
Events {
88-
#[arg(long)]
102+
#[arg(
103+
long,
104+
help = "VM identifier (optional, if not provided watches all VMs)"
105+
)]
89106
vm_id: Option<String>,
90107
},
108+
/// Connect to a virtual machine's console
91109
Console {
92-
#[arg(required = true)]
110+
#[arg(required = true, help = "VM identifier")]
93111
vm_id: String,
94112
},
113+
/// Attach a disk to a running virtual machine
95114
AttachDisk {
96-
#[arg(long, required = true)]
115+
#[arg(long, required = true, help = "VM identifier")]
97116
vm_id: String,
98-
#[arg(long, required = true)]
117+
#[arg(long, required = true, help = "Path to the disk image file")]
99118
path: String,
100119
},
120+
/// Remove a disk from a virtual machine
101121
RemoveDisk {
102-
#[arg(long, required = true)]
122+
#[arg(long, required = true, help = "VM identifier")]
103123
vm_id: String,
104-
#[arg(long, required = true)]
124+
#[arg(
125+
long,
126+
required = true,
127+
help = "Device identifier of the disk to remove"
128+
)]
105129
device_id: String,
106130
},
107131
}

0 commit comments

Comments
 (0)