From f34034ae583ed9ab5733f1ce75bf39d128111e6a Mon Sep 17 00:00:00 2001 From: Antoine Stevan <44101798+amtoine@users.noreply.github.com> Date: Tue, 7 Mar 2023 20:04:54 +0100 Subject: [PATCH] FIX: redirect to `encode base64` as `hash bash64` is deprecated (#8351) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description i tried yesterday to `encode` with an invalid character set and this is what i got ```bash >_ {alg: "HS256", type: "JWT"} | to json -r | encode base64 --character-set invalid-character-set Error: × value is not an accepted character set ╭─[entry #11:1:1] 1 │ {alg: "HS256", type: "JWT"} | to json -r | encode base64 --character-set invalid-character-set · ──────────┬────────── · ╰── invalid-character-set is not a valid character-set. Please use `help hash base64` to see a list of valid character sets. ╰──── ``` but `hash base64` is now a deprecated command, see `help hash base64`. => **this PR changes the error message to mention `help encode base64`, where the list of valid character sets is, instead** # User-Facing Changes ``` $nothing ``` # Tests + Formatting - :green_circle: `cargo fmt --all` - :green_circle: `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` - :green_circle: `cargo test --workspace` # After Submitting ``` $nothing ``` --- crates/nu-command/src/strings/encode_decode/base64.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-command/src/strings/encode_decode/base64.rs b/crates/nu-command/src/strings/encode_decode/base64.rs index bb73f0a62..e521c2838 100644 --- a/crates/nu-command/src/strings/encode_decode/base64.rs +++ b/crates/nu-command/src/strings/encode_decode/base64.rs @@ -93,7 +93,7 @@ fn action( not_valid => return Value::Error { error:ShellError::GenericError( "value is not an accepted character set".to_string(), format!( - "{not_valid} is not a valid character-set.\nPlease use `help hash base64` to see a list of valid character sets." + "{not_valid} is not a valid character-set.\nPlease use `help encode base64` to see a list of valid character sets." ), Some(config_character_set.span), None,