#cowsay #terminal #ascii #cli #cli-tool

app rustsay

一个简单的 Rust 命令行工具,模仿经典的 cowsay 程序,让牛在终端说出你的文本。

9 个版本

0.2.0 2024 年 8 月 10 日
0.1.9 2024 年 8 月 10 日

107文本处理

Download history 390/week @ 2024-08-05 81/week @ 2024-08-12

471 每月下载量

MIT 许可证

9KB

我一直在使用 VIM 和 CLI。所以有一天当我无聊的时候,我为什么不用它来激励我学习 Vim 和 Rust 呢?于是我做到了

fortune | cowsay | lolcat

为什么不用它作为学习 Vim 和 Rust 的动力呢?所以我做到了

安装

Cargo

cargo install rustsay

rustsay "Hello World"

Brew

# Add remote Tap
brew tap space7panda/rustsay https://github.com/space7panda/rustsay
# Installation might take some time if you dont have Rust dependencies in brew
brew install rustsay

从源代码

git clone https://github.com/space7panda/rustsay.git

cargo install --path .

rustsay --version

更新

Cargo

cargo install rustsay --force

rustsay --version

Brew

brew upgrade rustsay

rustsay --version

待办事项列表

  • 让它工作,哈哈
  • 添加 fortune 功能
  • 添加渐变功能
  • 添加更多字符?
  • 添加功能以将其添加为终端启动命令? 🤔

速度测试,为什么不呢?

cowsay

time cowsay "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
 _________________________________________
/ Lorem Ipsum is simply dummy text of the \
| printing and typesetting industry.      |
| Lorem Ipsum has been the industry's     |
| standard dummy text ever since the      |
| 1500s, when an unknown printer took a   |
| galley of type and scrambled it to make |
| a type specimen book. It has survived   |
| not only five centuries, but also the   |
| leap into electronic typesetting,       |
| remaining essentially unchanged. It was |
| popularised in the 1960s with the       |
| release of Letraset sheets containing   |
| Lorem Ipsum passages, and more recently |
| with desktop publishing software like   |
| Aldus PageMaker including versions of   |
\ Lorem Ipsum.                            /
 -----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
cowsay   0.01s user 0.00s system 83% cpu 0.015 total

rustsay

time rustsay "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
 _________________________________________
/ Lorem Ipsum is simply dummy text of     \
| the printing and typesetting industry.  |
| Lorem Ipsum has been the industry's     |
| standard dummy text ever since the      |
| 1500s, when an unknown printer took a   |
| galley of type and scrambled it to make |
| a type specimen book. It has survived   |
| not only five centuries, but also       |
| the leap into electronic typesetting,   |
| remaining essentially unchanged. It     |
| was popularised in the 1960s with the   |
| release of Letraset sheets containing   |
| Lorem Ipsum passages, and more recently |
| with desktop publishing software like   |
| Aldus PageMaker including versions of   |
\ Lorem Ipsum.                            /
 -----------------------------------------
     \   ^__^
      \  (oo)\_______
         (__)\       )\/\
             ||----w |
             ||     ||


rustsay 0.00s user 0.00s system 64% cpu 0.003 total

cowsay 0.01s 用户 0.00s 系统 83% cpu 0.015 总计

rustsay 0.00s 用户 0.00s 系统 64% cpu 0.003 总计

依赖项

~1.7–2.4MB
~37K SLoC