Skip to content

Commit be4aace

Browse files
committed
feat: enhance build commands with detailed descriptions and aliases
1 parent 3e0a195 commit be4aace

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

xtask/src/image.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,33 @@ pub struct ImageArgs {
4343
/// Image management commands
4444
#[derive(Subcommand)]
4545
pub enum ImageCommands {
46-
/// List all available image
46+
/// List all available images
4747
Ls,
48+
4849
/// Download the specified image and automatically extract it
4950
#[command(alias = "pull")]
5051
Download {
52+
/// Name of the image to download
5153
image_name: String,
54+
55+
/// Output directory for the downloaded image
5256
#[arg(short, long)]
5357
output_dir: Option<String>,
58+
59+
/// Automatically extract after download (default: true)
5460
#[arg(
5561
short,
5662
long,
5763
help = "Automatically extract after download (default: true)"
5864
)]
5965
extract: Option<bool>,
6066
},
67+
6168
/// Remove the specified image from temp directory
62-
Rm { image_name: String },
69+
Rm {
70+
/// Name of the image to remove
71+
image_name: String
72+
},
6373
}
6474

6575
/// Representation of a guest image

xtask/src/main.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,20 @@ struct Cli {
2929
enum Commands {
3030
/// Set default build configuration from board configs
3131
Defconfig {
32-
/// Board configuration name (e.g., qemu-aarch64, orangepi-5-plus)
32+
/// Board configuration name (e.g., qemu-aarch64, orangepi-5-plus, phytiumpi)
3333
board_name: String,
3434
},
35+
/// Build the ArceOS project with current configuration
3536
Build,
3637
/// Run clippy checks across all targets and feature combinations
3738
Clippy(ClippyArgs),
39+
/// Run ArceOS in QEMU emulation environment
3840
Qemu(QemuArgs),
41+
/// Run ArceOS with U-Boot bootloader
3942
Uboot(UbootArgs),
43+
/// Generate VM configuration schema
4044
Vmconfig,
45+
/// Interactive menu-based configuration editor
4146
Menuconfig,
4247
/// Guest Image management
4348
Image(image::ImageArgs),
@@ -47,10 +52,15 @@ enum Commands {
4752

4853
#[derive(Parser)]
4954
struct QemuArgs {
55+
/// Path to custom build configuration file (TOML format)
5056
#[arg(long)]
5157
build_config: Option<PathBuf>,
58+
59+
/// Path to custom QEMU configuration file
5260
#[arg(long)]
5361
qemu_config: Option<PathBuf>,
62+
63+
/// Comma-separated list of VM configuration files
5464
#[arg(long)]
5565
vmconfigs: Vec<String>,
5666
}
@@ -60,29 +70,39 @@ struct ClippyArgs {
6070
/// Only check specific packages (comma separated)
6171
#[arg(long)]
6272
packages: Option<String>,
73+
6374
/// Only check specific targets (comma separated)
6475
#[arg(long)]
6576
targets: Option<String>,
77+
6678
/// Continue on error instead of exiting immediately
6779
#[arg(long)]
6880
continue_on_error: bool,
81+
6982
/// Dry run - show what would be checked without running clippy
7083
#[arg(long)]
7184
dry_run: bool,
85+
7286
/// Automatically fix clippy warnings where possible
7387
#[arg(long)]
7488
fix: bool,
89+
7590
/// Allow fixing when the working directory is dirty (has uncommitted changes)
7691
#[arg(long)]
7792
allow_dirty: bool,
7893
}
7994

8095
#[derive(Parser)]
8196
struct UbootArgs {
97+
/// Path to custom build configuration file (TOML format)
8298
#[arg(long)]
8399
build_config: Option<PathBuf>,
100+
101+
/// Path to custom U-Boot configuration file
84102
#[arg(long)]
85103
uboot_config: Option<PathBuf>,
104+
105+
/// Comma-separated list of VM configuration files
86106
#[arg(long)]
87107
vmconfigs: Vec<String>,
88108
}
@@ -95,7 +115,10 @@ struct DevspaceArgs {
95115

96116
#[derive(Subcommand)]
97117
enum DevspaceCommand {
118+
/// Start the development workspace
98119
Start,
120+
121+
/// Stop the development workspace
99122
Stop,
100123
}
101124

0 commit comments

Comments
 (0)