diff --git a/Cargo.toml b/Cargo.toml index 00a8668..03269b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "runrs" version = "0.1.12" edition = "2018" license = "MIT/Apache-2.0" -description = "Run Rust Scripts" +description = "A Tool for Run Rust Scripts" readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 306b096..95ce6b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ fn main() { let args = env::args().skip(1).collect::>(); if args.is_empty() { - failure_and_exit!("runrs v{}, need arguments, `runrs --help` for help", env!("CARGO_PKG_VERSION")); + failure_and_exit!("runrs v{}, need arguments, `runrs -h` or `runrs --help` for help", env!("CARGO_PKG_VERSION")); } let first_argument = args.get(0).unwrap_or_else(|| failure_and_exit!("Must assign a script file name")); if first_argument == "--help" || first_argument == "-h" { @@ -95,27 +95,30 @@ fn write_script_file_to_src(script_file: &str, cache_script_bin_name: &str) { fn print_help() { println!(r##"{} v{} - {} -Help: -runrs -h|--help +Show help: +$ runrs -h|--help Show template: -runrs -t|--template +$ runrs -t|--template -Run Rust Script: -runrs [arguments] +Run script: +$ runrs [arguments] Binaries dir: ~/Library/Caches/rust-script/binaries/release/ Environment variables: -| Variable | Description | -| -------------------- | ------------------------------------------------------------ | -| HOME | User home, default by OS system | -| RUNRS_SKIP_CACHE | Skip compiled cached file, bool , turn on true, yes, on or 1 | -| RUNRS_REBUILD | Force rebuild, bool | -| RUNRS_SILENT_BUILD | Build new binary in silent mode, bool | -| RUNRS_RUST_SCRIPT | rust_script command line bin file | -| RUNRS_MAX_SCRIPT_LEN | Max script length, default 1MB | +┌──────────────────────┬────────────────────────────────────────────────┐ +│ Variable │ Description │ +├──────────────────────┼────────────────────────────────────────────────┤ +│ HOME │ User home, default by OS system │ +│ RUNRS_SKIP_CACHE │ Skip compiled cached file, `bool` │ +│ RUNRS_REBUILD │ Force rebuild, `bool` │ +│ RUNRS_SILENT_BUILD │ Build new binary in silent mode, `bool` │ +│ RUNRS_RUST_SCRIPT │ `rust_script` command line bin file │ +│ RUNRS_MAX_SCRIPT_LEN │ Max script length, default 1MB │ +└──────────────────────┴────────────────────────────────────────────────┘ +> Type `bool`: `true`, `yes`, `on` or `1` for true, otherwise false "##, env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"),