swapdex 0.1.6

Switch between multiple Claude Code and Codex login accounts, locally and safely.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Small helpers. `redact_path` replaces the home dir with `~` so no error or
//! status line leaks a username.

pub fn redact_path(s: &str) -> String {
    if let Some(home) = dirs::home_dir() {
        let home = home.to_string_lossy();
        if !home.is_empty() {
            return s.replace(home.as_ref(), "~");
        }
    }
    s.to_string()
}