diff options
author | NerdyPepper <[email protected]> | 2019-05-20 14:40:40 +0100 |
---|---|---|
committer | NerdyPepper <[email protected]> | 2019-05-20 14:40:40 +0100 |
commit | d61e0ff1e192c62085e842ba878cdb10bacd4c9e (patch) | |
tree | 8624f9e8f2ce0bf3cdc1de0a1b7214a6d442b03b /src | |
parent | 7bc593296e9a5ed693a30c92c25653d4a6cfcb54 (diff) |
add pista and pista_minimal prompts
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index bfa47a0..e0b8f41 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -3,11 +3,34 @@ mod prompt_char; | |||
3 | mod vcs; | 3 | mod vcs; |
4 | mod venv; | 4 | mod venv; |
5 | 5 | ||
6 | use colored::*; | ||
7 | |||
8 | fn main() { | 6 | fn main() { |
9 | print!("{}", cwd::cwd()); | 7 | println!("{}", pista()); |
8 | } | ||
9 | |||
10 | fn pista() -> String { | ||
11 | let cwd = cwd::cwd(); | ||
12 | let (branch, status) = vcs::vcs_status().unwrap_or(("".into(), "".into())); | ||
13 | let venv = venv::get_name(); | ||
14 | let prompt_char = prompt_char::get_char(); | ||
15 | format!("{cwd} {branch} {status}\n{venv}{pchar} ", | ||
16 | cwd=cwd, | ||
17 | branch=branch, | ||
18 | status=status, | ||
19 | venv=venv, | ||
20 | pchar=prompt_char | ||
21 | ) | ||
22 | } | ||
23 | |||
24 | fn pista_minimal() -> String { | ||
25 | let cwd = cwd::cwd(); | ||
10 | let (branch, status) = vcs::vcs_status().unwrap_or(("".into(), "".into())); | 26 | let (branch, status) = vcs::vcs_status().unwrap_or(("".into(), "".into())); |
11 | println!(" {} {}", branch, status.dimmed()); | 27 | let venv = venv::get_name(); |
12 | print!("{}{} ", venv::get_name(), prompt_char::prompt_char()); | 28 | let prompt_char = prompt_char::get_char(); |
29 | format!("{cwd} {branch}{status}{venv}{pchar}", | ||
30 | cwd=cwd, | ||
31 | branch=branch, | ||
32 | status=status, | ||
33 | venv=venv, | ||
34 | pchar=prompt_char | ||
35 | ) | ||
13 | } | 36 | } |