-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3726562
commit d4a5693
Showing
11 changed files
with
258 additions
and
50 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use std::path::PathBuf; | ||
|
||
use clap::Parser; | ||
use serde::Deserialize; | ||
|
||
use crate::{config::Config, utils::main_sync}; | ||
|
||
#[derive(Parser, Deserialize, Default, Clone, Debug)] | ||
pub struct GitMoverCli { | ||
#[arg(short, long, visible_alias = "from")] | ||
pub source: Option<String>, | ||
#[arg(short, long, visible_alias = "to")] | ||
pub destination: Option<String>, | ||
#[arg(short, long = "no-forks")] | ||
pub no_forks: bool, | ||
#[arg(short, long)] | ||
pub config: Option<String>, | ||
#[arg(short, long, action = clap::ArgAction::Count)] | ||
pub verbose: u8, | ||
} | ||
|
||
pub async fn cli_main() { | ||
let args = GitMoverCli::parse(); | ||
let mut config = match &args.config { | ||
Some(path_str) => { | ||
let path = PathBuf::from(path_str); | ||
Config::new_from_path(&path) | ||
} | ||
None => Config::new(), | ||
} | ||
.set_debug(args.verbose) | ||
.with_cli_args(args); | ||
main_sync(&mut config).await; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.