File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed
Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ id-error-cannot-find-user-name = cannot find name for user ID { $uid }
2525id-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
2829id-help-audit = Display the process audit user ID and other process audit properties,
2930 which requires privilege (not available on Linux).
3031id-help-user = Display only the effective user ID as a number.
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ id-error-cannot-find-user-name = impossible de trouver le nom pour l'ID utilisat
2525id-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
2829id-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).
3031id-help-user = Affiche uniquement l'ID utilisateur effectif sous forme de nombre.
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ fn get_context_help_text() -> String {
6969}
7070
7171mod 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' )
Original file line number Diff line number Diff 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) ]
2227fn test_id_no_specified_user ( ) {
You can’t perform that action at this time.
0 commit comments