2021-12-30 02:47:34 +00:00
|
|
|
pub mod config;
|
2021-12-29 16:49:24 +00:00
|
|
|
|
2021-12-29 13:15:19 +00:00
|
|
|
use std::error::Error;
|
2021-12-30 02:47:34 +00:00
|
|
|
use std::path::PathBuf;
|
2021-12-29 13:15:19 +00:00
|
|
|
|
2021-12-30 02:47:34 +00:00
|
|
|
pub fn run_configure(
|
|
|
|
paths: Vec<PathBuf>,
|
|
|
|
_matches: &clap::ArgMatches,
|
|
|
|
) -> Result<(), Box<dyn Error>> {
|
2021-12-29 16:49:24 +00:00
|
|
|
// Check if we already have a local config somewhere. If so, reprompt the
|
|
|
|
// same configuration options and override the values present in the current
|
|
|
|
// YAML file.
|
2021-12-30 02:47:34 +00:00
|
|
|
match config::read_config(&paths) {
|
|
|
|
Ok(_) => {
|
|
|
|
print!("successfully read\n");
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
Err(config::Error::MissingConfig) => {
|
|
|
|
print!("missing config\n");
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
Err(e) => Err(Box::new(e)),
|
|
|
|
}
|
2021-12-29 16:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn run_push(_matches: &clap::ArgMatches) -> Result<(), Box<dyn Error>> {
|
|
|
|
Ok(())
|
2021-12-29 13:15:19 +00:00
|
|
|
}
|
|
|
|
|
2021-12-29 16:49:24 +00:00
|
|
|
pub fn run_pull(_matches: &clap::ArgMatches) -> Result<(), Box<dyn Error>> {
|
|
|
|
Ok(())
|
2021-12-29 13:15:19 +00:00
|
|
|
}
|
|
|
|
|
2021-12-29 16:49:24 +00:00
|
|
|
pub fn run_add(_matches: &clap::ArgMatches) -> Result<(), Box<dyn Error>> {
|
2021-12-29 13:15:19 +00:00
|
|
|
Ok(())
|
|
|
|
}
|