forked from NotAShelf/beer
beer: initial project scaffolding
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I07c4ee715f51332893e2466b8c52f8eb6a6a6964
This commit is contained in:
parent
c9b8424bd1
commit
35ea435776
4 changed files with 99 additions and 13 deletions
49
Cargo.lock
generated
49
Cargo.lock
generated
|
|
@ -17,6 +17,16 @@ version = "1.0.102"
|
|||
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"
|
||||
|
|
@ -71,6 +81,26 @@ version = "0.2.17"
|
|||
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"
|
||||
|
|
@ -214,6 +244,16 @@ version = "0.1.1"
|
|||
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"
|
||||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
49
src/main.rs
Normal file
49
src/main.rs
Normal file
|
|
@ -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")
|
||||
}
|
||||
7
terminfo/beer.info
Normal file
7
terminfo/beer.info
Normal file
|
|
@ -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,
|
||||
Loading…
Add table
Add a link
Reference in a new issue