tico

Crates.iotico
lib.rstico
version2.0.0
created_at2017-10-20 11:34:59.801079+00
updated_at2020-06-03 15:58:04.886387+00
descriptionTico provides a path shortener for use with command prompts.
homepagehttps://github.com/portocodes/tico
repositoryhttps://github.com/portocodes/tico
max_upload_size
id36339
size18,376
Ricardo Mendes (locks)

documentation

http://portocodes.github.io/tico/tico/index.html

README

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|~|"))

Commit count: 0

cargo fmt