Skip to content

Commit d61d448

Browse files
committed
Implement --help
1 parent 98f97d3 commit d61d448

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/help.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Wrapper for `cargo build` that cross-compiles core, compiler_builtins and alloc
2+
3+
USAGE:
4+
cargo xbuild [OPTIONS]
5+
6+
OPTIONS:
7+
-h, --help Prints help information and exit
8+
---version Prints version information and exit
9+
10+
Any additional options are directly passed to `cargo build` (see
11+
`cargo build --help` for possible options).

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ mod sysroot;
3131
mod util;
3232
mod xargo;
3333

34+
const HELP: &str = include_str!("help.txt");
35+
3436
// We use a different sysroot for Native compilation to avoid file locking
3537
//
3638
// Cross compilation requires `lib/rustlib/$HOST` to match `rustc`'s sysroot,
@@ -118,7 +120,10 @@ fn run() -> Result<Option<ExitStatus>> {
118120
let (command, args) = cli::args()?;
119121
match command {
120122
Command::Build => Ok(Some(build(args)?)),
121-
Command::Help => unimplemented!(),
123+
Command::Help => {
124+
print!("{}", HELP);
125+
Ok(None)
126+
}
122127
Command::Version => {
123128
writeln!(
124129
io::stdout(),

0 commit comments

Comments
 (0)