Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/uu/id/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/uu/id/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions src/uu/id/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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')
Expand Down
5 changes: 5 additions & 0 deletions tests/by-util/test_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading