Compare commits
No commits in common. "2d88ac6f45ef932a2b5cbe7a79a5622e864250ff" and "662137297d9c44d8c4b368eae8e9d4e564f23715" have entirely different histories.
2d88ac6f45
...
662137297d
7 changed files with 0 additions and 87 deletions
|
@ -13,10 +13,6 @@ Gets Windows environment variables from DOS.
|
|||
A hacked-together utility for sending WSL variables back to 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`
|
||||
|
||||
A Linux utility to quickly make a bash script to run a Windows executable with
|
||||
|
|
2
hug/.gitignore
vendored
2
hug/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
/target
|
||||
Cargo.lock
|
|
@ -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"
|
||||
|
10
hug/justfile
10
hug/justfile
|
@ -1,10 +0,0 @@
|
|||
|
||||
alias b := build
|
||||
alias i := install
|
||||
|
||||
build:
|
||||
cargo build --release
|
||||
|
||||
install DIR: build
|
||||
cp ./target/release/hug "{{DIR}}/hug"
|
||||
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
1
justfile
1
justfile
|
@ -11,7 +11,6 @@ install TARGET='all' DIR="~/.bin/":
|
|||
just install scripts {{DIR}}
|
||||
just install dos-var {{DIR}}
|
||||
just install env-share {{DIR}}
|
||||
just install hug {{DIR}}
|
||||
just install mkwin {{DIR}}
|
||||
just install path-convert {{DIR}}
|
||||
just install qdls {{DIR}}
|
||||
|
|
25
man/hug.1
25
man/hug.1
|
@ -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
|
Loading…
Reference in a new issue