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

bin+lib tico

Tico provides a path shortener for use with command prompts

2 stable releases

Uses old Rust 2015

2.0.0 Jun 3, 2020
1.0.0 Oct 20, 2017

#13 in #shortener

Download history 1/week @ 2023-12-11 4/week @ 2023-12-18 21/week @ 2024-02-19 42/week @ 2024-02-26 26/week @ 2024-03-04 37/week @ 2024-03-11 34/week @ 2024-03-18

140 downloads per month
Used in 4 crates

MIT license

5KB
75 lines

The best README is probably the test cases:

#[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");
}

Install

$ cargo install --git git@github.com:portocodes/tico.git

Use

Here's how I'm using it in fish_prompt.fish to replace prompt_pwd:

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

Dependencies

~65–540KB