summaryrefslogtreecommitdiffstats
path: root/src/options.rs
diff options
context:
space:
mode:
authorPascal Hertleif <killercup@gmail.com>2015-03-10 18:36:29 +0100
committerPascal Hertleif <killercup@gmail.com>2015-03-10 18:36:29 +0100
commit7dc3a02185bbfbc1cdf3f148bcb76932a562d3df (patch)
tree726e42158c5ef2ff1ac206fb53a938e3494b4c7a /src/options.rs
parentcf38f90aa95fccacd9276a0f638e3edd9797f698 (diff)
Make Git Column Optional
Closes #47
Diffstat (limited to 'src/options.rs')
-rw-r--r--src/options.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/options.rs b/src/options.rs
index ec015f9..f23da3d 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -72,6 +72,10 @@ impl Options {
opts.optflag("", "version", "display version of exa");
opts.optflag("?", "help", "show list of command-line options");
+ if cfg!(feature="git") {
+ opts.optflag("", "git", "show git status");
+ }
+
if xattr::feature_implemented() {
opts.optflag("@", "extended", "display extended attribute keys and sizes in long (-l) output");
}
@@ -490,6 +494,7 @@ pub struct Columns {
links: bool,
blocks: bool,
group: bool,
+ git: bool
}
impl Columns {
@@ -501,6 +506,7 @@ impl Columns {
links: matches.opt_present("links"),
blocks: matches.opt_present("blocks"),
group: matches.opt_present("group"),
+ git: matches.opt_present("git"),
})
}
@@ -545,7 +551,7 @@ impl Columns {
if cfg!(feature="git") {
if let Some(d) = dir {
- if d.has_git_repo() {
+ if self.git && d.has_git_repo() {
columns.push(GitStatus);
}
}