clone
ssh://git@git.notashelf.dev:33/notashelf/beer.gitCommit 35ea43577618
tarballunverified4 files changed+99-13
@@ -18,6 +18,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]]+name = "beer"+version = "0.0.0"+dependencies = [+ "anyhow",+ "pound",+ "tracing",+ "tracing-subscriber",+]++[[package]] name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index"@@ -72,6 +82,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]]+name = "pound"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b29188deca8885da40aaafd27d756c5d94420fb8ba8a569663c7a87fef6d28ad"+dependencies = [+ "pound-derive",+]++[[package]]+name = "pound-derive"+version = "0.1.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "215966bbf23c9af48d9014a71bc426ecf9be95ffb04b5f1ae3e64f8d8a2a920c"+dependencies = [+ "proc-macro2",+ "quote",+ "venial",+]++[[package]] name = "proc-macro2" version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index"@@ -215,6 +245,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]]+name = "venial"+version = "0.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9a42528baceab6c7784446df2a10f4185078c39bf73dc614f154353f1a6b1229"+dependencies = [+ "proc-macro2",+ "quote",+]++[[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index"@@ -228,12 +268,3 @@ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", ]--[[package]]-name = "wterm"-version = "0.0.0"-dependencies = [- "anyhow",- "tracing",- "tracing-subscriber",-]@@ -1,20 +1,19 @@ [package]-name = "wterm"+name = "beer" version = "0.0.0" edition = "2024"-rust-version = "1.95"+rust-version = "1.95.0" description = "A fast, software-rendered, Wayland-native terminal emulator" license = "EUPL-1.2" readme = true-default-run = "wterm" [dependencies] anyhow = "1.0.102"+pound = "0.1.6" tracing = "0.1.44" tracing-subscriber = { version = "0.3.23", features = ["env-filter"] } [lints.rust]-rust_2018_idioms = { level = "warn", priority = -1 } unsafe_op_in_unsafe_fn = "deny" missing_debug_implementations = "warn" @@ -0,0 +1,49 @@+//! beer, a fast, software-rendered, Wayland-native terminal emulator.++use std::process::ExitCode;++use pound::Parse;++/// A fast, software-rendered, Wayland-native terminal emulator.+#[derive(Parse)]+#[pound(name = "beer", version = "0.0.0")]+struct Cli {+ /// Run as a daemon hosting multiple windows.+ #[pound(long)]+ server: bool,+}++fn main() -> ExitCode {+ init_logging();+ match run(Cli::parse()) {+ Ok(()) => ExitCode::SUCCESS,+ Err(err) => {+ tracing::error!("{err:#}");+ eprintln!("beer: {err:#}");+ ExitCode::FAILURE+ }+ }+}++fn init_logging() {+ use tracing_subscriber::{EnvFilter, fmt};++ let filter = EnvFilter::try_from_env("BEER_LOG")+ .or_else(|_| EnvFilter::try_from_default_env())+ .unwrap_or_else(|_| EnvFilter::new("warn"));++ fmt()+ .with_env_filter(filter)+ .with_writer(std::io::stderr)+ .init();+}++fn run(cli: Cli) -> anyhow::Result<()> {+ if cli.server {+ tracing::info!("starting beer server");+ todo!("server mode")+ }++ tracing::info!("starting beer");+ todo!("window mode")+}@@ -0,0 +1,7 @@+# beer terminfo entry. Inherits xterm-256color; only the deltas live here.+#+# Compile with extended (user-defined) capabilities:+# tic -x -o "$out" terminfo/beer.info+beer|beer-256color|beer terminal emulator,+ Tc,+ use=xterm-256color,