From ef877364d43bcf61c48ce632be0a35fd445239e7 Mon Sep 17 00:00:00 2001 From: Ayaz Hafiz Date: Thu, 5 May 2022 09:04:34 -0400 Subject: [PATCH] Allow invalid UTF-8 for `roc format` argument Presumably with a new version of clap that was introduced, we must now specify that invalid-utf8 is permitted in order to run `matches.values_of_os` as we do on line 174 of cli/src/main.rs: ```rust Some((CMD_FORMAT, matches)) => { let maybe_values = matches.values_of_os(DIRECTORY_OR_FILES); ``` Otherwise, clap panics: ``` thread 'main' panicked at 'Must use `Arg::allow_invalid_utf8` with `_os` lookups at `DIRECTORY_OR_FILES`', cli/src/main.rs:174:40 ``` --- cli/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/lib.rs b/cli/src/lib.rs index b12b85a728..b9d5e60f6a 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -157,7 +157,8 @@ pub fn build_app<'a>() -> Command<'a> { Arg::new(DIRECTORY_OR_FILES) .index(1) .multiple_values(true) - .required(false)) + .required(false) + .allow_invalid_utf8(true)) .arg( Arg::new(FLAG_CHECK) .long(FLAG_CHECK)