Open
Description
As mentioned in the section on Adding CLI Arguments
- follow the steps and you will see the following output on the command line
cargo run -p cli -- --help
wasm-runner 0.1.0
Sample project from https://vino.dev/blog/node-to-rust-day-1-rustup/
USAGE:
cli
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
The example code at this point should look like this
use my_lib::Module;
use structopt::{clap::AppSettings, StructOpt};
#[macro_use]
extern crate log;
#[derive(StructOpt)]
#[structopt(
name = "wasm-runner",
about = "Sample project from https://vino.dev/blog/node-to-rust-day-1-rustup/",
global_settings(&[
AppSettings::ColoredHelp
]),
)]
struct CliOptions {}
fn main() {
env_logger::init();
debug!("Initialized logger");
match Module::from_file("./module.wasm") {
Ok(_) => {
info!("Module loaded");
}
Err(e) => {
error!("Module failed to load: {}", e);
}
}
}
Now when we run our cli we see… nothing at all.
Metadata
Metadata
Assignees
Labels
No labels