1
2use crate::{paths::Paths, steam::SteamData};
3
4mod runnable;
5pub use runnable::*;
6
7pub mod backup;
8pub mod desktop_entry;
9pub mod info;
10pub mod install;
11pub mod move_compat;
12pub mod restore;
13pub mod run;
14pub mod uninstall;
15
16#[cfg_attr(feature = "commandline", derive(clap::Subcommand))]
17pub enum ProtonCommand {
18    Run(run::Run),
20
21    MoveCompat(move_compat::MoveCompat),
23
24    Backup(backup::Backup),
26
27    Restore(restore::Restore),
29
30    Install(install::Install),
33
34    Uninstall(uninstall::Uninstall),
37
38    Info(info::Info),
40
41    DesktopEntry(desktop_entry::MakeDE),
43}
44
45impl Runnable for ProtonCommand {
46    fn run(&self, paths: &Paths, steam_data: &SteamData) -> RunnableResult<()> {
47        match self {
48            ProtonCommand::Run(r) => r.run(paths, steam_data),
49            ProtonCommand::MoveCompat(m) => m.run(paths, steam_data),
50            ProtonCommand::Backup(b) => b.run(paths, steam_data),
51            ProtonCommand::Restore(r) => r.run(paths, steam_data),
52            ProtonCommand::Install(i) => i.run(paths, steam_data),
53            ProtonCommand::Uninstall(u) => u.run(paths, steam_data),
54            ProtonCommand::Info(i) => i.run(paths, steam_data),
55            ProtonCommand::DesktopEntry(d) => d.run(paths, steam_data),
56        }
57    }
58}