diff --git a/src/uu/id/locales/en-US.ftl b/src/uu/id/locales/en-US.ftl index 37b477c17a8..a6b4ac2256f 100644 --- a/src/uu/id/locales/en-US.ftl +++ b/src/uu/id/locales/en-US.ftl @@ -25,6 +25,7 @@ id-error-cannot-find-user-name = cannot find name for user ID { $uid } id-error-audit-retrieve = couldn't retrieve information # Help text for command-line arguments +id-help-ignore = ignore, for compatibility with other versions id-help-audit = Display the process audit user ID and other process audit properties, which requires privilege (not available on Linux). id-help-user = Display only the effective user ID as a number. diff --git a/src/uu/id/locales/fr-FR.ftl b/src/uu/id/locales/fr-FR.ftl index f69df611e22..b606f520757 100644 --- a/src/uu/id/locales/fr-FR.ftl +++ b/src/uu/id/locales/fr-FR.ftl @@ -25,6 +25,7 @@ id-error-cannot-find-user-name = impossible de trouver le nom pour l'ID utilisat id-error-audit-retrieve = impossible de récupérer les informations # Texte d'aide pour les arguments de ligne de commande +id-help-ignore = ignore, pour compatibilité avec d'autres versions id-help-audit = Affiche l'ID utilisateur d'audit du processus et autres propriétés d'audit, ce qui nécessite des privilèges (non disponible sous Linux). id-help-user = Affiche uniquement l'ID utilisateur effectif sous forme de nombre. diff --git a/src/uu/id/src/id.rs b/src/uu/id/src/id.rs index 7c1e1c12c5a..dcdc692435d 100644 --- a/src/uu/id/src/id.rs +++ b/src/uu/id/src/id.rs @@ -69,6 +69,7 @@ fn get_context_help_text() -> String { } mod options { + pub const OPT_IGNORE: &str = "ignore"; pub const OPT_AUDIT: &str = "audit"; // GNU's id does not have this pub const OPT_CONTEXT: &str = "context"; pub const OPT_EFFECTIVE_USER: &str = "user"; @@ -353,6 +354,13 @@ pub fn uu_app() -> Command { .infer_long_args(true) .args_override_self(true) .after_help(translate!("id-after-help")) + .arg( + Arg::new(options::OPT_IGNORE) + .short('a') + .long(options::OPT_IGNORE) + .help(translate!("id-help-ignore")) + .action(ArgAction::SetTrue), + ) .arg( Arg::new(options::OPT_AUDIT) .short('A') diff --git a/tests/by-util/test_id.rs b/tests/by-util/test_id.rs index 7a7d5e9a169..169fbe2abcf 100644 --- a/tests/by-util/test_id.rs +++ b/tests/by-util/test_id.rs @@ -17,6 +17,11 @@ fn test_invalid_arg() { new_ucmd!().arg("--definitely-invalid").fails_with_code(1); } +#[test] +fn test_id_ignore() { + new_ucmd!().arg("-a").succeeds(); +} + #[test] #[allow(unused_mut)] fn test_id_no_specified_user() {