#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 3/week @ 2024-11-13 14/week @ 2024-11-20 26/week @ 2024-11-27 38/week @ 2024-12-04 74/week @ 2024-12-11 17/week @ 2024-12-18 4/week @ 2024-12-25 34/week @ 2025-01-01 26/week @ 2025-01-08 50/week @ 2025-01-15 26/week @ 2025-01-22 21/week @ 2025-01-29 47/week @ 2025-02-05 65/week @ 2025-02-12 18/week @ 2025-02-19 66/week @ 2025-02-26

202 downloads per month
Used in 5 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–520KB