mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-04-29 05:09:47 +08:00
merge ff 未测试
This commit is contained in:
13
src/cli.rs
13
src/cli.rs
@@ -1,7 +1,7 @@
|
||||
use clap::{ArgGroup, Parser, Subcommand};
|
||||
use mit::commands::{
|
||||
add::add, branch::branch, commit::commit, init::init, log::log, remove::remove, restore::restore, status::status,
|
||||
switch::switch,
|
||||
add::add, branch::branch, commit::commit, init::init, log::log, merge::merge, remove::remove, restore::restore,
|
||||
status::status, switch::switch,
|
||||
};
|
||||
|
||||
/// Rust实现的简易版本的Git,用于学习Rust语言
|
||||
@@ -117,6 +117,12 @@ enum Command {
|
||||
#[clap(long, short = 'S', action)]
|
||||
staged: bool,
|
||||
},
|
||||
/// merge
|
||||
Merge {
|
||||
/// 要合并的分支
|
||||
#[clap(required = true)]
|
||||
branch: String,
|
||||
},
|
||||
}
|
||||
pub fn handle_command() {
|
||||
let cli = Cli::parse();
|
||||
@@ -162,5 +168,8 @@ pub fn handle_command() {
|
||||
}
|
||||
restore(path, source.unwrap(), worktree, staged);
|
||||
}
|
||||
Command::Merge { branch } => {
|
||||
merge(branch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user