2020-07-07 20:11:42 +00:00
|
|
|
use clap::{App, Arg, SubCommand};
|
|
|
|
|
|
|
|
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
|
|
|
pub const AUTHORS: &str = env!("CARGO_PKG_AUTHORS");
|
|
|
|
pub const DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");
|
|
|
|
|
|
|
|
pub const IN_WASM_PATH: &str = "in-wasm-path";
|
|
|
|
|
|
|
|
pub fn build<'a, 'b>() -> App<'a, 'b> {
|
|
|
|
SubCommand::with_name("build")
|
|
|
|
.about("build provided Rust project to Wasm")
|
|
|
|
.args(&[Arg::with_name(IN_WASM_PATH)
|
|
|
|
.takes_value(true)
|
|
|
|
.short("i")
|
2020-07-09 14:06:08 +00:00
|
|
|
.help("path to a Cargo.toml file")])
|
2020-07-07 20:11:42 +00:00
|
|
|
}
|
|
|
|
|
2020-07-09 12:55:58 +00:00
|
|
|
pub fn show_wit<'a, 'b>() -> App<'a, 'b> {
|
|
|
|
SubCommand::with_name("show")
|
|
|
|
.about("show WIT in provided Wasm file")
|
|
|
|
.args(&[Arg::with_name(IN_WASM_PATH)
|
|
|
|
.required(true)
|
|
|
|
.takes_value(true)
|
|
|
|
.short("i")
|
2020-07-09 14:06:08 +00:00
|
|
|
.help("path to the Wasm file")])
|
2020-07-09 12:55:58 +00:00
|
|
|
}
|
|
|
|
|
2020-07-07 20:11:42 +00:00
|
|
|
pub fn validate<'a, 'b>() -> App<'a, 'b> {
|
|
|
|
SubCommand::with_name("validate")
|
|
|
|
.about("validates provided Wasm file to suite Fluence network requirements")
|
|
|
|
.args(&[Arg::with_name(IN_WASM_PATH)
|
|
|
|
.required(true)
|
|
|
|
.takes_value(true)
|
|
|
|
.short("i")
|
|
|
|
.help("path to the wasm file")])
|
|
|
|
}
|