| Crates.io | tico |
| lib.rs | tico |
| version | 2.0.0 |
| created_at | 2017-10-20 11:34:59.801079+00 |
| updated_at | 2020-06-03 15:58:04.886387+00 |
| description | Tico provides a path shortener for use with command prompts. |
| homepage | https://github.com/portocodes/tico |
| repository | https://github.com/portocodes/tico |
| max_upload_size | |
| id | 36339 |
| size | 18,376 |
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");
}
$ cargo install --git git@github.com:portocodes/tico.git
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|~|"))