| Crates.io | slow-scan-print |
| lib.rs | slow-scan-print |
| version | 2.1.0 |
| created_at | 2024-06-24 18:37:58.676645+00 |
| updated_at | 2025-08-25 04:57:40.338658+00 |
| description | Text is printed at fixed intervals by character or by line, and its name is inspired by SSTV (Slow Scan Television). |
| homepage | |
| repository | https://github.com/Meow0x7E/slow-scan-print |
| max_upload_size | |
| id | 1282435 |
| size | 77,886 |
一个以固定时间间隔逐字符或逐行打印文本的命令行工具,其名称灵感来源于慢扫描电视(SSTV)。
在依赖配置中禁用默认 features 即可排除 bin 所需的依赖
slow-scan-print = { version = "2.0.0", default-features = false }
cargo install slow-scan-print
git clone https://github.com/Meow0x7E/slow-scan-print.git
cd slow-scan-print
cargo build --release
编译后的二进制文件位于 target/release/slow-scan-print。
# 从标准输入读取并逐字符打印
echo "Hello, World!" | slow-scan-print
# 从文件读取并逐行打印
slow-scan-print -l file.txt
# 同时读取多个文件
slow-scan-print file1.txt file2.txt
| 选项 | 缩写 | 说明 |
|---|---|---|
--delay |
-d |
设置基础延迟时间(默认:20ms) |
--full-width-delay |
-f |
设置全角字符延迟(默认:2 × delay) |
--control-char-delay |
-c |
设置控制字符延迟(默认:0) |
--tail-delay |
-t |
是否在最后一个字符后也延迟 |
--line-mode |
-l |
启用逐行模式 |
--hide-cursor |
-i |
隐藏终端光标 |
--help |
-h |
显示帮助信息 |
--version |
-v |
显示版本信息 |
支持以下时间单位:
y, year, 年 (年)mon, month, 月 (月)w, week, 周 (周)d, day, 日 (日)h, hr, hour, 小时 (小时)m, min, minute, 分钟 (分钟)s, sec, second, 秒 (秒)ms, msec, millisecond, 毫秒 (毫秒)µs, µsec, microsecond, 微秒 (微秒)ns, nsec, nanosecond, 纳秒 (纳秒)支持简单算术表达式,例如:
slow-scan-print -d "100ms * 2" file.txt # 200ms 延迟
slow-scan-print -d "1.5h + 30m" file.txt # 2小时延迟
slow-scan-print -d 50ms --full-width-delay 100ms chinese.txt
slow-scan-print -l -c log.txt
cat story.txt | slow-scan-print -d 30ms
欢迎提交 Issue 和 Pull Request!
请确保代码风格与现有代码一致,并通过 cargo test 和 cargo clippy 检查。
本项目基于 MIT 许可证 发布。