#path #shortener #command #letter #prompt #test #test-cases

bin+lib tico

蒂科提供用于命令提示符的路径缩短功能

2 个稳定版本

使用旧的 Rust 2015

2.0.0 2020年6月3日
1.0.0 2017年10月20日

#13 in #shortener

Download history 37/week @ 2024-03-11 34/week @ 2024-03-18 28/week @ 2024-03-25 85/week @ 2024-04-01 10/week @ 2024-04-08 12/week @ 2024-04-15 33/week @ 2024-04-22 15/week @ 2024-04-29 13/week @ 2024-05-06 18/week @ 2024-05-13 8/week @ 2024-05-20 26/week @ 2024-05-27 21/week @ 2024-06-03 11/week @ 2024-06-10 11/week @ 2024-06-17 12/week @ 2024-06-24

57 每月下载量
用于 4 crates

MIT 许可证

5KB
75 lines

最好的 README 文件可能是 测试用例

#[test]
fn it_works() {
    assert_eq!(tico("~"), "~");
    assert_eq!(tico("/"), "/");
    assert_eq!(tico("/home/hugopeixoto/work/personal/tico"), "/h/h/w/p/tico");
    assert_eq!(tico("~/work/personal/tico"), "~/w/p/tico");
    assert_eq!(tico("~/work/personal/tico/"), "~/w/p/t/");
    assert_eq!(tico("~/work/ééé/tico"), "~/w/é/tico");
}

安装

$ cargo install --git [email protected]:portocodes/tico.git

使用

以下是在 fish_prompt.fish 中使用它的示例,以替换 prompt_pwd

set-l cwd$cyan(tico(echo$PWD |sed-e"s|^$HOME|~|"))

依赖

~65–520KB