use clap::Subcommand;
use crate::{config::Config, errors::GeneralError};
pub(crate) mod sync;
#[derive(Subcommand, Debug, Clone)]
pub(crate) enum ShortcutsSubcommand {
#[cfg(feature = "git-mover")]
SyncGit,
#[command(alias = "s")]
SyncAll,
}
impl ShortcutsSubcommand {
pub fn run(&self, config: &mut Config) -> Result<(), GeneralError> {
match self {
ShortcutsSubcommand::SyncAll => Self::sync_all(config),
#[cfg(feature = "git-mover")]
ShortcutsSubcommand::SyncGit => {
use crate::commands::Commands;
use git_mover::PlatformType;
let git_mover_inst = git_mover::GitMoverCli {
source: Some(PlatformType::Github),
destination: Some(PlatformType::Codeberg),
manual: true,
..Default::default()
};
Commands::git_mover(git_mover_inst)
}
}
}
}