We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2494fa commit c9a61ddCopy full SHA for c9a61dd
crates/rune/src/cli.rs
@@ -136,6 +136,23 @@ impl<'a> Entry<'a> {
136
}
137
138
139
+ /// Run the configured application without starting a new tokio runtime.
140
+ ///
141
+ /// This will take over stdout and stdin.
142
+ pub async fn run_async(self) -> ! {
143
+ match self.inner().await {
144
+ Ok(exit_code) => {
145
+ std::process::exit(exit_code as i32);
146
+ }
147
+ Err(error) => {
148
+ let o = std::io::stderr();
149
+ // ignore error because stdout / stderr might've been closed.
150
+ let _ = format_errors(o.lock(), &error);
151
+ std::process::exit(ExitCode::Failure as i32);
152
153
154
155
+
156
async fn inner(mut self) -> Result<ExitCode> {
157
let args = match Args::try_parse() {
158
Ok(args) => args,
0 commit comments