Skip to content

Commit

Permalink
Make Git Column Optional
Browse files Browse the repository at this point in the history
Closes #47
  • Loading branch information
killercup committed Mar 10, 2015
1 parent cf38f90 commit 7dc3a02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -490,6 +494,7 @@ pub struct Columns {
links: bool,
blocks: bool,
group: bool,
git: bool
}

impl Columns {
Expand All @@ -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"),
})
}

Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 7dc3a02

Please sign in to comment.