aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: e0b8f41c4c16cd04ecfba113f75437b3c957b64c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
mod cwd;
mod prompt_char;
mod vcs;
mod venv;

fn main() {
    println!("{}", pista());
}

fn pista() -> String {
    let cwd = cwd::cwd();
    let (branch, status) = vcs::vcs_status().unwrap_or(("".into(), "".into()));
    let venv = venv::get_name();
    let prompt_char = prompt_char::get_char();
    format!("{cwd} {branch} {status}\n{venv}{pchar} ",
            cwd=cwd,
            branch=branch,
            status=status,
            venv=venv,
            pchar=prompt_char
            )
}

fn pista_minimal() -> String {
    let cwd = cwd::cwd();
    let (branch, status) = vcs::vcs_status().unwrap_or(("".into(), "".into()));
    let venv = venv::get_name();
    let prompt_char = prompt_char::get_char();
    format!("{cwd} {branch}{status}{venv}{pchar}",
            cwd=cwd,
            branch=branch,
            status=status,
            venv=venv,
            pchar=prompt_char
            )
}