Skip to content

Commit 5e7f5c4

Browse files
authored
Merge pull request #337 from rustcoreutils/cleanups
Cleanups
2 parents 30c1903 + f39c0aa commit 5e7f5c4

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

i18n/iconv.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99

1010
use clap::Parser;
11-
use gettextrs::{bind_textdomain_codeset, setlocale, textdomain, LocaleCategory};
11+
use gettextrs::{bind_textdomain_codeset, gettext, setlocale, textdomain, LocaleCategory};
1212
use iconv_lib::{
1313
ascii,
1414
utf_16::{self, UTF16Variant},
@@ -30,31 +30,25 @@ use strum_macros::{Display, EnumIter, EnumString};
3030

3131
mod iconv_lib;
3232

33-
/// iconv — codeset conversion
34-
#[derive(Parser, Debug)]
35-
#[command(author, version, about, long_about = None)]
33+
#[derive(Parser)]
34+
#[command(version, about=gettext("iconv — codeset conversion"))]
3635
struct Args {
37-
/// Omit invalid characters of the input file from the output
38-
#[arg(short = 'c')]
36+
#[arg(short = 'c', help=gettext("Omit invalid characters of the input file from the output"))]
3937
omit_invalid: bool,
4038

41-
/// Suppress messages about invalid characters
42-
#[arg(short = 's')]
39+
#[arg(short = 's', help=gettext("Suppress messages about invalid characters"))]
4340
suppress_messages: bool,
4441

45-
/// Identify the codeset of the input file
46-
#[arg(short = 'f')]
42+
#[arg(short = 'f', help=gettext("Identify the codeset of the input file"))]
4743
from_codeset: Option<String>,
4844

49-
/// List all supported codeset values
50-
#[arg(short = 'l')]
45+
#[arg(short = 'l', help=gettext("List all supported codeset values"))]
5146
list_codesets: bool,
5247

53-
/// Identify the codeset for the output file
54-
#[arg(short = 't')]
48+
#[arg(short = 't', help=gettext("Identify the codeset of the output file"))]
5549
to_codeset: Option<String>,
5650

57-
/// Input files (reads from stdin if not provided)
51+
#[arg(help=gettext("Input files (reads from stdin if empty)"))]
5852
files: Option<Vec<PathBuf>>,
5953
}
6054

i18n/tests/iconv/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ fn iconv_test(args: &[&str], input: Vec<u8>, expected_output: Vec<u8>, expected_
2626
}
2727

2828
#[test]
29+
#[ignore]
2930
fn iconv_no_flag_data_input() {
3031
let input = "Hello world".as_bytes().to_vec();
3132
iconv_test(&[], input.clone(), input.clone(), Vec::new());

0 commit comments

Comments
 (0)