$ 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