From 76bfe7b9b77f55e66e37c2a39ae3cb2299b4b08d Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 14 Oct 2024 15:41:29 -0400 Subject: [PATCH 1/2] i18n/tests/iconv: temp test disable, due to Linux failure See bug #336 --- i18n/tests/iconv/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/i18n/tests/iconv/mod.rs b/i18n/tests/iconv/mod.rs index 3fb4b265..2c3342dc 100644 --- a/i18n/tests/iconv/mod.rs +++ b/i18n/tests/iconv/mod.rs @@ -26,6 +26,7 @@ fn iconv_test(args: &[&str], input: Vec, expected_output: Vec, expected_ } #[test] +#[ignore] fn iconv_no_flag_data_input() { let input = "Hello world".as_bytes().to_vec(); iconv_test(&[], input.clone(), input.clone(), Vec::new()); From f39c0aa1c91cd20fc1eebbbb37de7512850f9b31 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 14 Oct 2024 15:46:39 -0400 Subject: [PATCH 2/2] iconv: gettext cleanups --- i18n/iconv.rs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/i18n/iconv.rs b/i18n/iconv.rs index 41a7de32..5636ed28 100644 --- a/i18n/iconv.rs +++ b/i18n/iconv.rs @@ -8,7 +8,7 @@ // use clap::Parser; -use gettextrs::{bind_textdomain_codeset, setlocale, textdomain, LocaleCategory}; +use gettextrs::{bind_textdomain_codeset, gettext, setlocale, textdomain, LocaleCategory}; use iconv_lib::{ ascii, utf_16::{self, UTF16Variant}, @@ -30,31 +30,25 @@ use strum_macros::{Display, EnumIter, EnumString}; mod iconv_lib; -/// iconv — codeset conversion -#[derive(Parser, Debug)] -#[command(author, version, about, long_about = None)] +#[derive(Parser)] +#[command(version, about=gettext("iconv — codeset conversion"))] struct Args { - /// Omit invalid characters of the input file from the output - #[arg(short = 'c')] + #[arg(short = 'c', help=gettext("Omit invalid characters of the input file from the output"))] omit_invalid: bool, - /// Suppress messages about invalid characters - #[arg(short = 's')] + #[arg(short = 's', help=gettext("Suppress messages about invalid characters"))] suppress_messages: bool, - /// Identify the codeset of the input file - #[arg(short = 'f')] + #[arg(short = 'f', help=gettext("Identify the codeset of the input file"))] from_codeset: Option, - /// List all supported codeset values - #[arg(short = 'l')] + #[arg(short = 'l', help=gettext("List all supported codeset values"))] list_codesets: bool, - /// Identify the codeset for the output file - #[arg(short = 't')] + #[arg(short = 't', help=gettext("Identify the codeset of the output file"))] to_codeset: Option, - /// Input files (reads from stdin if not provided) + #[arg(help=gettext("Input files (reads from stdin if empty)"))] files: Option>, }