summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-11-06 02:36:29 -0400
committerJesse Luehrs <doy@tozt.net>2021-11-06 02:36:29 -0400
commit66cdb4e85efaa2e9abf270fc875239b6790c4a40 (patch)
treea1a6b9a636eaaec40ab9111b3aa7b52396f741af /src/main.rs
parent47223328fca9c4de70c7c99cbdfd16038b5be4da (diff)
downloadnbsh-66cdb4e85efaa2e9abf270fc875239b6790c4a40.tar.gz
nbsh-66cdb4e85efaa2e9abf270fc875239b6790c4a40.zip
basic skeleton
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index e7a11a9..f1fce9f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,16 @@
+use async_std::io::WriteExt as _;
+
+async fn async_main() -> anyhow::Result<()> {
+ async_std::io::stdout().write_all(b"hello world\n").await?;
+ Ok(())
+}
+
fn main() {
- println!("Hello, world!");
+ match async_std::task::block_on(async_main()) {
+ Ok(_) => (),
+ Err(e) => {
+ eprintln!("nbsh: {}", e);
+ std::process::exit(1);
+ }
+ };
}