Crates.io | khat |
lib.rs | khat |
version | 0.1.4 |
source | src |
created_at | 2023-11-30 09:02:39.07781 |
updated_at | 2023-12-05 09:34:18.307328 |
description | A cat clone, nothing more nothing less |
homepage | |
repository | |
max_upload_size | |
id | 1054017 |
size | 24,541 |
A cat clone implemented in Rust written in the most idiomatic way I know
First install the app:
cargo intsall khat
If you want to get help for the subcommands:
khat -h
You will receive this output:
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
The normal way to use this will be to print the file as is:
khat Cargo.toml
Output:
[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 https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
clap = { version = "4.4.10", features = ["derive"]}
You can also reverse the lines of the document:
khat -l Cargo.toml
Output:
clap = { version = "4.4.10", features = ["derive"]}
[dependencies]
# See more keys and their definitions at https://doc.rust-lang.org/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]
Another option is reversing the characters within the line
khat -c Cargo.toml
Output:
]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
As a final option you can combine both:
khat -r Cargo.toml
Output:
}]"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[