git_global/subcommands/list.rs
1//! The `list` subcommand: lists all repos known to git-global.
2
3use crate::config::Config;
4use crate::errors::Result;
5use crate::report::Report;
6
7/// Forces the display of each repo path, without any extra output.
8pub fn execute(mut config: Config) -> Result<Report> {
9 let repos = config.get_repos();
10 let mut report = Report::new(&repos);
11 for repo in repos.iter() {
12 // Report.print() already prints out the repo name if it has any
13 // messages, so just add an empty string to force display of the repo
14 // name.
15 report.add_repo_message(repo, String::new());
16 }
17 Ok(report)
18}