aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2019-05-19 18:33:40 +0100
committerNerdyPepper <[email protected]>2019-05-19 18:33:40 +0100
commit7757ab6c366f6ee4ffc596b641cd2db6ea7d2771 (patch)
tree954637dfc8cc54d5f973acc53980d65bd2113d78
parent2589f9cfa100426d45b759a0a55a10f2b7a2835e (diff)
im happy with colors
-rw-r--r--src/main.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 8bacacb..48ddbf8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,7 +4,6 @@ use git2::{ Repository, Status };
4use colored::*; 4use colored::*;
5 5
6fn main() { 6fn main() {
7 println!("{:?}", env::var("GIT_DIRTY"));
8 print!("{}", cwd()); 7 print!("{}", cwd());
9 let (branch, status) = match vcs_status() { 8 let (branch, status) = match vcs_status() {
10 Some((x, y)) => { 9 Some((x, y)) => {
@@ -12,8 +11,8 @@ fn main() {
12 }, 11 },
13 None => ("".into(), "".into()) 12 None => ("".into(), "".into())
14 }; 13 };
15 println!(" {} {}", branch.green(), status.dimmed()); 14 println!(" {} {}", branch, status.dimmed());
16 print!("{}", prompt_char()); 15 print!("{} ", prompt_char());
17} 16}
18 17
19fn cwd() -> String { 18fn cwd() -> String {
@@ -53,7 +52,7 @@ fn vcs_status() -> Option<(colored::ColoredString, String)> {
53 } else { 52 } else {
54 let commit = reference.peel_to_commit().unwrap(); 53 let commit = reference.peel_to_commit().unwrap();
55 let id = commit.id(); 54 let id = commit.id();
56 branch = format!("{}", id).yellow(); 55 branch = format!("{:.6}", id).yellow();
57 } 56 }
58 57
59 let mut repo_stat = String::new(); 58 let mut repo_stat = String::new();