kaspa_cli_lib/modules/
exit.rs

1use crate::imports::*;
2
3#[derive(Default, Handler)]
4#[help("Exit the application")]
5pub struct Exit;
6
7impl Exit {
8    async fn main(self: Arc<Self>, ctx: &Arc<dyn Context>, _argv: Vec<String>, _cmd: &str) -> cli::Result<()> {
9        let term = ctx.term();
10
11        term.writeln("bye!");
12        #[cfg(not(target_arch = "wasm32"))]
13        term.exit().await;
14        #[cfg(target_arch = "wasm32")]
15        workflow_dom::utils::window().location().reload().ok();
16
17        Ok(())
18    }
19}