/// Update action the CLI should perform after the TUI exits. /// /// aKode updates itself with `akode update`; the only action requested from the TUI is the /// daemon package replacement chosen in the daemon menu. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum UpdateAction { /// Replace the local daemon after restoring the terminal. Daemon(DaemonUpdateSource), } /// Package source explicitly selected by the user in the daemon menu. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum DaemonUpdateSource { PublicStable, ThisCli, } impl DaemonUpdateSource { pub fn command_args(self) -> &'static [&'static str] { match self { Self::PublicStable => &["app-server", "daemon", "update"], Self::ThisCli => &["app-server", "daemon", "update", "--from-cli", "--yes"], } } }