feat: remove file from index
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
use crate::subcommands::{
|
||||
add::AddSubcommand, hash_object::HashObjectSubcommand, init::InitSubcommand,
|
||||
remove::RemoveSubcommand, test::TestSubcommand,
|
||||
add::AddSubcommand, hash_object::HashObjectSubcommand, init::InitSubcommand, rm::RmSubcommand,
|
||||
test::TestSubcommand,
|
||||
};
|
||||
use anyhow::Result;
|
||||
|
||||
mod add;
|
||||
mod hash_object;
|
||||
mod init;
|
||||
mod remove;
|
||||
mod rm;
|
||||
mod test;
|
||||
|
||||
#[derive(clap::Parser, Debug)]
|
||||
pub enum SubcommandType {
|
||||
/// Add file(s) to index
|
||||
Add(AddSubcommand),
|
||||
/// Remove file from the working and the index
|
||||
Remove(RemoveSubcommand),
|
||||
/// Remove file(s) from the index
|
||||
Rm(RmSubcommand),
|
||||
/// Init a Git repository
|
||||
Init(InitSubcommand),
|
||||
HashObject(HashObjectSubcommand),
|
||||
@@ -30,7 +30,7 @@ impl Subcommand for SubcommandType {
|
||||
fn run(&self) -> Result<String> {
|
||||
match self {
|
||||
Self::Add(cmd) => cmd.run(),
|
||||
Self::Remove(cmd) => cmd.run(),
|
||||
Self::Rm(cmd) => cmd.run(),
|
||||
Self::Init(cmd) => cmd.run(),
|
||||
Self::HashObject(cmd) => cmd.run(),
|
||||
Self::Test(cmd) => cmd.run(),
|
||||
|
||||
Reference in New Issue
Block a user