feat: v0.2.5, support go scripts

This commit is contained in:
2024-12-29 17:13:41 +08:00
parent affcb233bd
commit 3ace53b509
11 changed files with 163 additions and 31 deletions

39
src/help_rs.rs Normal file
View File

@@ -0,0 +1,39 @@
pub fn print_help() {
println!(r##"{} v{} - {}
Show help:
$ runrs -h|--help
Show template:
$ runrs -t|--template
Show scriptions:
$ runrs -l|--list
Install script:
$ runrs -i|--install <script.rs>
Run script:
$ runrs <script.rs> [arguments]
Binaries dir:
~/Library/Caches/rust-script/binaries/release/
Environment variables:
┌──────────────────────┬────────────────────────────────────────────────┐
│ Variable │ Description │
├──────────────────────┼────────────────────────────────────────────────┤
│ HOME │ User home, default from 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"),
env!("CARGO_PKG_DESCRIPTION")
);
}