1//! The `install-manpage` subcommand: attempts to install a man page.
23use crate::config::Config;
4use crate::errors::Result;
5use crate::report::Report;
67// TODO(peap): Add option to just generate the file for the user to stick somewhere?
89/// Attempts to install git-global's man page to the relevant directory.
10/// This is a work-around to not maintaining distribution-specific packages
11/// and Cargo not providing this functionality for crates.
12pub fn execute(mut config: Config) -> Result<Report> {
13let repos = config.get_repos();
14let mut report = Report::new(&repos);
15 report.add_message("This feature is a work-in-progress.".to_string());
16 report.add_message(
17"In the meantime, you can find the manpage at \
18 https://raw.githubusercontent.com/peap/git-global/master/doc/git-global.1".to_string()
19 );
20if let Some(manpage_file) = config.manpage_file {
21 report.add_message(format!(
22"...would write file to {}",
23 manpage_file.display()
24 ));
25 } else {
26 report.add_message("...not sure where to put it!".to_string());
27 }
28Ok(report)
29}