mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-03-24 14:01:04 +08:00
实现:status命令
TODO:add 不存在的文件报错
This commit is contained in:
@@ -4,6 +4,7 @@ use mit::commands::commit::commit;
|
||||
use mit::commands::init::init;
|
||||
use mit::commands::log::log;
|
||||
use mit::commands::remove::remove;
|
||||
use mit::commands::status::status;
|
||||
|
||||
/// Rust实现的简易版本的Git,用于学习Rust语言
|
||||
#[derive(Parser)]
|
||||
@@ -51,6 +52,8 @@ enum Command {
|
||||
#[clap(long, action)]
|
||||
allow_empty: bool,
|
||||
},
|
||||
/// 查看当前状态
|
||||
Status,
|
||||
/// log 现实提交历史
|
||||
Log {
|
||||
#[clap(short = 'A', long)]
|
||||
@@ -75,6 +78,9 @@ pub fn handle_command() {
|
||||
Command::Commit { message, allow_empty } => {
|
||||
commit(message, allow_empty);
|
||||
}
|
||||
Command::Status => {
|
||||
status();
|
||||
}
|
||||
Command::Log { all, number } => {
|
||||
log(all, number);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user