Skip to content

Commit c7e4e62

Browse files
committed
sh: fix unwrap
1 parent 86e7856 commit c7e4e62

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sh/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,13 @@ fn main() -> Result<(), Box<dyn Error>> {
246246
textdomain("posixutils-rs")?;
247247
bind_textdomain_codeset("posixutils-rs", "UTF-8")?;
248248

249-
let args = parse_args(std::env::args().collect(), is_attached_to_terminal()).unwrap();
249+
let args = match parse_args(std::env::args().collect(), is_attached_to_terminal()) {
250+
Ok(args) => args,
251+
Err(err) => {
252+
eprintln!("{err}");
253+
std::process::exit(1);
254+
}
255+
};
250256
let mut shell = Shell::initialize_from_system(
251257
args.program_name,
252258
args.arguments,

0 commit comments

Comments
 (0)