Compare commits

..

No commits in common. "2d88ac6f45ef932a2b5cbe7a79a5622e864250ff" and "662137297d9c44d8c4b368eae8e9d4e564f23715" have entirely different histories.

7 changed files with 0 additions and 87 deletions

View file

@ -13,10 +13,6 @@ Gets Windows environment variables from DOS.
A hacked-together utility for sending WSL variables back to Windows A hacked-together utility for sending WSL variables back to Windows
shells. The utility runs in WSL, and companion scripts run in Windows. shells. The utility runs in WSL, and companion scripts run in Windows.
## `hug`
A barebones command wrapper for turning binary-output text into normal text.
## `mkwin` ## `mkwin`
A Linux utility to quickly make a bash script to run a Windows executable with A Linux utility to quickly make a bash script to run a Windows executable with

2
hug/.gitignore vendored
View file

@ -1,2 +0,0 @@
/target
Cargo.lock

View file

@ -1,13 +0,0 @@
[package]
name = "hug"
version = "0.0.1"
edition = "2021"
[profile.release]
opt-level = 's'
codegen-units = 1
debug = false
lto = true
panic = "abort"
strip = "symbols"

View file

@ -1,10 +0,0 @@
alias b := build
alias i := install
build:
cargo build --release
install DIR: build
cp ./target/release/hug "{{DIR}}/hug"

View file

@ -1,32 +0,0 @@
use std::{
env,
process::{ Command, Stdio }
};
fn main() {
let mut args: Vec<String> = env::args().collect();
args.remove(0);
let target = args.remove(0);
let command = Command::new(target)
.args(args)
.stderr(Stdio::inherit())
.output();
if let Ok(output) = command {
let mut line = String::new();
for byte in output.stdout {
match char::from_u32(byte.into()) {
Some('\n') => {
println!("{line}");
line = String::new();
},
Some('\0') |
None => continue,
Some(c) => line.push(c),
}
}
}
}

View file

@ -11,7 +11,6 @@ install TARGET='all' DIR="~/.bin/":
just install scripts {{DIR}} just install scripts {{DIR}}
just install dos-var {{DIR}} just install dos-var {{DIR}}
just install env-share {{DIR}} just install env-share {{DIR}}
just install hug {{DIR}}
just install mkwin {{DIR}} just install mkwin {{DIR}}
just install path-convert {{DIR}} just install path-convert {{DIR}}
just install qdls {{DIR}} just install qdls {{DIR}}

View file

@ -1,25 +0,0 @@
.Dd $Mdocdate$
.Dt HUG 1
.Os WSL
.Sh NAME
.Nm hug
.Nd wraps processes and converts binary output to text
.Sh SYNOPSIS
.Nm
.Ar target
.Op Ar args...
.Sh DESCRIPTION
The
.Nm
utility runs a process and emits bytes from standard output to text.
.Sh EXAMPLES
WSL's help text is output as binary content, preventing piping to utilities like
.Xr less 1
or
.Xr bat 1 :
.Pp
.Dl $ hug wsl --help | less
.Pp
.Sh Authors
.An -nosplit
.An Valerie Wolfe Aq Mt sleeplessval@gmail.com