diff --git a/src/commands.rs b/src/commands.rs index af91fb24..6735f7d9 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -1,3 +1,4 @@ +pub mod backup; pub mod bucket; pub mod cache; pub mod cat; @@ -8,7 +9,6 @@ pub mod depends; pub mod describe; #[cfg(feature = "download")] pub mod download; -pub mod export; pub mod home; pub mod hook; pub mod info; @@ -140,8 +140,10 @@ pub enum Commands { Home(home::Args), /// Show content of specified manifest Cat(cat::Args), + #[cfg(not(feature = "v2"))] + #[cfg_attr(not(feature = "v2"), command_name = "backup export")] /// Exports installed apps, buckets (and optionally configs) in JSON format - Export(export::Args), + Export(backup::export::Args), /// Check for common issues Checkup(checkup::Args), #[cfg(feature = "download")] diff --git a/src/commands/backup.rs b/src/commands/backup.rs new file mode 100644 index 00000000..e76171c6 --- /dev/null +++ b/src/commands/backup.rs @@ -0,0 +1,25 @@ +use clap::{Parser, Subcommand}; +use sfsu_derive::Runnable; +use sprinkles::{config, contexts::ScoopContext}; + +use super::{Command, CommandRunner}; + +pub mod export; + +#[derive(Debug, Clone, Subcommand, Runnable)] +pub enum Commands { + /// Exports installed apps, buckets (and optionally configs) in JSON format + Export(export::Args), +} + +#[derive(Debug, Clone, Parser)] +pub struct Args { + #[clap(subcommand)] + command: Commands, +} + +impl super::Command for Args { + async fn runner(self, ctx: &impl ScoopContext) -> anyhow::Result<()> { + self.command.run(ctx).await + } +} diff --git a/src/commands/export.rs b/src/commands/backup/export.rs similarity index 100% rename from src/commands/export.rs rename to src/commands/backup/export.rs