diff --git a/src/uu/uniq/locales/en-US.ftl b/src/uu/uniq/locales/en-US.ftl
index 3106270cba9..6c6c475e8bb 100644
--- a/src/uu/uniq/locales/en-US.ftl
+++ b/src/uu/uniq/locales/en-US.ftl
@@ -22,22 +22,17 @@ uniq-help-zero-terminated = end lines with 0 byte, not newline
uniq-error-write-line-terminator = Could not write line terminator
uniq-error-write-error = write error
uniq-error-read-error = read error
-uniq-error-invalid-argument = Invalid argument for { $opt_name }: { $arg }
-uniq-error-try-help = Try 'uniq --help' for more information.
-uniq-error-group-mutually-exclusive = --group is mutually exclusive with -c/-d/-D/-u
-uniq-error-group-badoption = invalid argument 'badoption' for '--group'
+uniq-error-invalid-argument = { $arg }: invalid number of { $kind }
+uniq-error-invalid-choice = invalid argument '{ $arg }' for '--{ $option }'
Valid arguments are:
- - 'prepend'
- - 'append'
- - 'separate'
- - 'both'
-
-uniq-error-all-repeated-badoption = invalid argument 'badoption' for '--all-repeated'
+ { $choices }
+ Try 'uniq --help' for more information.
+uniq-error-ambiguous-choice = ambiguous argument '{ $arg }' for '--{ $option }'
Valid arguments are:
- - 'none'
- - 'prepend'
- - 'separate'
-
+ { $choices }
+ Try 'uniq --help' for more information.
+uniq-error-try-help = Try 'uniq --help' for more information.
+uniq-error-group-mutually-exclusive = --group is mutually exclusive with -c/-d/-D/-u
uniq-error-counts-and-repeated-meaningless = printing all duplicated lines and repeat counts is meaningless
Try 'uniq --help' for more information.
diff --git a/src/uu/uniq/locales/fr-FR.ftl b/src/uu/uniq/locales/fr-FR.ftl
index 094af7001bb..7bf72d2f730 100644
--- a/src/uu/uniq/locales/fr-FR.ftl
+++ b/src/uu/uniq/locales/fr-FR.ftl
@@ -21,22 +21,17 @@ uniq-help-zero-terminated = terminer les lignes avec un octet 0, pas une nouvell
uniq-error-write-line-terminator = Impossible d'écrire le terminateur de ligne
uniq-error-write-error = erreur d'écriture
uniq-error-read-error = erreur de lecture
-uniq-error-invalid-argument = Argument invalide pour { $opt_name } : { $arg }
+uniq-error-invalid-argument = { $arg } : nombre invalide de { $kind }
+uniq-error-invalid-choice = argument '{ $arg }' invalide pour '--{ $option }'
+ Les arguments valides sont :
+ { $choices }
+ Essayez 'uniq --help' pour plus d'informations.
+uniq-error-ambiguous-choice = argument '{ $arg }' ambigu pour '--{ $option }'
+ Les arguments valides sont :
+ { $choices }
+ Essayez 'uniq --help' pour plus d'informations.
uniq-error-try-help = Essayez 'uniq --help' pour plus d'informations.
uniq-error-group-mutually-exclusive = --group est mutuellement exclusif avec -c/-d/-D/-u
-uniq-error-group-badoption = argument invalide 'badoption' pour '--group'
- Arguments valides :
- - 'prepend'
- - 'append'
- - 'separate'
- - 'both'
-
-uniq-error-all-repeated-badoption = argument invalide 'badoption' pour '--all-repeated'
- Arguments valides :
- - 'none'
- - 'prepend'
- - 'separate'
-
uniq-error-counts-and-repeated-meaningless = afficher toutes les lignes dupliquées et les nombres de répétitions n'a pas de sens
Essayez 'uniq --help' pour plus d'informations.
uniq-error-could-not-open = Impossible d'ouvrir { $path }
diff --git a/src/uu/uniq/src/uniq.rs b/src/uu/uniq/src/uniq.rs
index 6b3416d8ded..1cdc67786aa 100644
--- a/src/uu/uniq/src/uniq.rs
+++ b/src/uu/uniq/src/uniq.rs
@@ -2,10 +2,9 @@
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
-// spell-checker:ignore badoption CTYPE
+// spell-checker:ignore CTYPE
use clap::{
- Arg, ArgAction, ArgMatches, Command, builder::ValueParser, error::ContextKind, error::Error,
- error::ErrorKind,
+ Arg, ArgAction, ArgMatches, Command, builder::ValueParser, error::Error, error::ErrorKind,
};
use std::ffi::{OsStr, OsString};
use std::fs::File;
@@ -14,7 +13,6 @@ use std::num::IntErrorKind;
use uucore::display::Quotable;
use uucore::error::{FromIo, UError, UResult, USimpleError};
use uucore::format_usage;
-use uucore::parser::shortcut_value_parser::ShortcutValueParser;
use uucore::posix::{OBSOLETE, posix_version};
use uucore::translate;
@@ -339,7 +337,17 @@ impl Uniq {
}
}
-fn opt_parsed(opt_name: &str, matches: &ArgMatches) -> UResult