shrinkpath 0.1.1

Smart cross-platform path shortening for CLIs, prompts, and tools
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub mod ellipsis;
pub mod fish;
pub mod hybrid;
pub mod unique;

/// Shortening strategy.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Strategy {
    /// Replace middle segments with `...`: `/Users/john/.../file.txt`
    Ellipsis,
    /// Abbreviate intermediate dirs to first char: `/U/j/p/r/file.txt`
    Fish,
    /// Graduated approach: fish expendable segments first, then ellipsis, then fish identity.
    Hybrid,
    /// Disambiguate segments by finding the shortest unique prefix among siblings.
    Unique,
}