loopd, bxctl, inferproxy: read args_os instead of panicking

M3a review finding 7, for the other three roles. loopd keeps its config path
as a path; bxctl and inferproxy take text arguments and answer one that is
not UTF-8 with their usage.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-22 21:07:59 -07:00
co-authored by Claude Opus 5.5
parent 6af89f7c60
commit 33994d0dc6
6 changed files with 97 additions and 11 deletions
+5 -1
View File
@@ -7,7 +7,11 @@ use std::process;
use inferproxy::{Limits, serve};
fn main() {
let args: Vec<String> = env::args().collect();
// `args_os`, because `args` panics on an argument that is not UTF-8.
let args: Vec<String> = match env::args_os().map(|a| a.into_string()).collect() {
Ok(args) => args,
Err(_) => usage(),
};
let mut listen: Option<String> = None;
let mut upstream: Option<String> = None;
let mut i = 1;