use argh::FromArgs; /// Clean Flash Player Installer /// /// Install Clean Flash Player with GUI, TUI, or silent mode. #[derive(FromArgs)] pub struct InstallerArgs { /// use the terminal UI (ratatui) instead of the graphical window #[argh(switch)] pub cli: bool, /// run the installation non-interactively (no GUI or TUI) #[argh(switch)] pub install: bool, /// suppress all output (only valid with --install) #[argh(switch)] pub silent: bool, /// install the Modern Browsers (MV3) native host #[argh(switch)] pub native_host: bool, /// install the Pepper API (PPAPI) plugin #[argh(switch)] pub pepper: bool, /// install the Netscape API (NPAPI) plugin #[argh(switch)] pub netscape: bool, /// install the ActiveX (OCX) plugin #[argh(switch)] pub activex: bool, /// install the standalone Flash Player #[argh(switch)] pub player: bool, /// create desktop shortcuts for standalone player (requires --player) #[argh(switch)] pub player_desktop: bool, /// create start menu shortcuts for standalone player (requires --player) #[argh(switch)] pub player_start_menu: bool, /// install the debug version #[argh(switch)] pub debug: bool, } /// The mode in which the application should run. pub enum RunMode { Gui, Tui, Silent, } impl InstallerArgs { pub fn determine_mode(&self) -> RunMode { if self.install { RunMode::Silent } else if self.cli { RunMode::Tui } else { RunMode::Gui } } }