#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 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 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–520KB