Crates.io | tim-rust-minigrep |
lib.rs | tim-rust-minigrep |
version | 0.1.1 |
source | src |
created_at | 2023-06-13 02:21:45.849372 |
updated_at | 2023-06-13 02:45:46.727799 |
description | A Minigrep |
homepage | |
repository | |
max_upload_size | |
id | 888608 |
size | 6,054 |
$ cargo run -- 被搜索关键字 example-filename.txt
$ cargo run -- to poem.txt
携带环境变量
IGNORE_CASE=1 cargo run -- to poem.txt
如果你使用 PowerShell,则需要用两个命令来分别设置环境变量并运行程序:
PS> $Env:IGNORE_CASE=1; cargo run to poem.txt
on Windows:
set RUST_BACKTRACE=1
tauri dev
只有标准输出会输出到 output.txt 文件; 标准错误输出(eprintln!),则不会。
cargo run > output.txt