#clone #cat #line #reverse #characters #nothing #reversing

bin+lib khat

A cat clone, nothing more nothing less

5 个版本

0.1.4 2023 年 12 月 5 日
0.1.3 2023 年 12 月 5 日
0.1.2 2023 年 12 月 1 日
0.1.1 2023 年 11 月 30 日
0.1.0 2023 年 11 月 30 日

702文本处理

每月 35 次下载

MIT 许可证

15KB
248

khat

使用我最熟悉的方式实现的 Rust 编写的 cat 克隆

如何使用它

首先安装应用程序

cargo intsall khat

查看帮助

如果您想获取子命令的帮助

khat -h

您将收到以下输出

Usage: khat.exe [OPTIONS] <FILE>

Arguments:
  <FILE>  The file to the path

Options:
  -f, --full-rev   Displays the file content reversing it entirely
  -l, --line-rev   Displays the file content reversing only the lines
  -c, --chars-rev  Displays the file content reversing only the characters within the lines
  -h, --help       Print help

正常使用

使用此工具的正常方式是将文件按原样打印出来

khat Cargo.toml

输出

[package]
name = "khat"
version = "0.1.0"
edition = "2021"
license = "MIT"
description = "A cat clone, nothing more nothing less"
authors = ["kinire98"]

# See more keys and their definitions at http://doc.rust-lang.net.cn/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.4.10", features = ["derive"]}

反转行

您也可以反转文档中的行

khat -l Cargo.toml

输出

clap = { version = "4.4.10", features = ["derive"]}
[dependencies]

# See more keys and their definitions at http://doc.rust-lang.net.cn/cargo/reference/manifest.html

authors = ["kinire98"]
description = "A cat clone, nothing more nothing less"
license = "MIT"
edition = "2021"
version = "0.1.0"
name = "khat"
[package]

反转字符

另一个选项是反转行内的字符

khat -c Cargo.toml

输出

]egakcap[
"tahk" = eman
"0.1.0" = noisrev
"1202" = noitide
"TIM" = esnecil
"ssel gnihton erom gnihton ,enolc tac A" = noitpircsed
]"89erinik"[ = srohtua

lmth.tsefinam/ecnerefer/ograc/gro.gnal-tsur.cod//:sptth ta snoitinifed rieht dna syek erom eeS #

]seicnedneped[
}]"evired"[ = serutaef ,"01.4.4" = noisrev { = palc

完全反转

作为最后一个选项,您可以将两者结合起来

khat -r Cargo.toml

输出

}]"evired"[ = serutaef ,"01.4.4" = noisrev { = palc
]seicnedneped[

lmth.tsefinam/ecnerefer/ograc/gro.gnal-tsur.cod//:sptth ta snoitinifed rieht dna syek erom eeS #

]"89erinik"[ = srohtua
"ssel gnihton erom gnihton ,enolc tac A" = noitpircsed
"TIM" = esnecil
"1202" = noitide
"0.1.0" = noisrev
"tahk" = eman
]egakcap[

依赖关系

~1–11MB
~85K SLoC