Skip to content

Commit 1e149b0

Browse files
authored
id: added '-a' argument (#8733)
1 parent 12e875c commit 1e149b0

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

src/uu/id/locales/en-US.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ id-error-cannot-find-user-name = cannot find name for user ID { $uid }
2525
id-error-audit-retrieve = couldn't retrieve information
2626
2727
# Help text for command-line arguments
28+
id-help-ignore = ignore, for compatibility with other versions
2829
id-help-audit = Display the process audit user ID and other process audit properties,
2930
which requires privilege (not available on Linux).
3031
id-help-user = Display only the effective user ID as a number.

src/uu/id/locales/fr-FR.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ id-error-cannot-find-user-name = impossible de trouver le nom pour l'ID utilisat
2525
id-error-audit-retrieve = impossible de récupérer les informations
2626
2727
# Texte d'aide pour les arguments de ligne de commande
28+
id-help-ignore = ignore, pour compatibilité avec d'autres versions
2829
id-help-audit = Affiche l'ID utilisateur d'audit du processus et autres propriétés d'audit,
2930
ce qui nécessite des privilèges (non disponible sous Linux).
3031
id-help-user = Affiche uniquement l'ID utilisateur effectif sous forme de nombre.

src/uu/id/src/id.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ fn get_context_help_text() -> String {
6969
}
7070

7171
mod options {
72+
pub const OPT_IGNORE: &str = "ignore";
7273
pub const OPT_AUDIT: &str = "audit"; // GNU's id does not have this
7374
pub const OPT_CONTEXT: &str = "context";
7475
pub const OPT_EFFECTIVE_USER: &str = "user";
@@ -353,6 +354,13 @@ pub fn uu_app() -> Command {
353354
.infer_long_args(true)
354355
.args_override_self(true)
355356
.after_help(translate!("id-after-help"))
357+
.arg(
358+
Arg::new(options::OPT_IGNORE)
359+
.short('a')
360+
.long(options::OPT_IGNORE)
361+
.help(translate!("id-help-ignore"))
362+
.action(ArgAction::SetTrue),
363+
)
356364
.arg(
357365
Arg::new(options::OPT_AUDIT)
358366
.short('A')

tests/by-util/test_id.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ fn test_invalid_arg() {
1717
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);
1818
}
1919

20+
#[test]
21+
fn test_id_ignore() {
22+
new_ucmd!().arg("-a").succeeds();
23+
}
24+
2025
#[test]
2126
#[allow(unused_mut)]
2227
fn test_id_no_specified_user() {

0 commit comments

Comments
 (0)