Просмотр исходного кода

Add Columns a flag to determine whether or not to show status for subdirectories that are git repos (#730)

	modified:   src/options/view.rs
	modified:   src/output/table.rs
alpn 5 лет назад
Родитель
Сommit
b55fde43fa
2 измененных файлов с 3 добавлено и 1 удалено
  1. 2 1
      src/options/view.rs
  2. 1 0
      src/output/table.rs

+ 2 - 1
src/options/view.rs

@@ -193,6 +193,7 @@ impl Columns {
     fn deduce(matches: &MatchedFlags<'_>) -> Result<Self, OptionsError> {
         let time_types = TimeTypes::deduce(matches)?;
         let git = cfg!(feature = "git") && matches.has(&flags::GIT)?;
+        let subdir_git_repos = git;
 
         let blocks = matches.has(&flags::BLOCKS)?;
         let group  = matches.has(&flags::GROUP)?;
@@ -204,7 +205,7 @@ impl Columns {
         let filesize =    ! matches.has(&flags::NO_FILESIZE)?;
         let user =        ! matches.has(&flags::NO_USER)?;
 
-        Ok(Self { time_types, git, octal, blocks, group, inode, links, permissions, filesize, user })
+        Ok(Self { time_types, git, subdir_git_repos, octal, blocks, group, inode, links, permissions, filesize, user })
     }
 }
 

+ 1 - 0
src/output/table.rs

@@ -39,6 +39,7 @@ pub struct Columns {
     pub blocks: bool,
     pub group: bool,
     pub git: bool,
+    pub subdir_git_repos: bool,
     pub octal: bool,
 
     // Defaults to true: