@@ -51,6 +51,25 @@ pub(crate) fn job_format_codes() -> Vec<String> {
5151 . to_vec ( )
5252}
5353
54+ /// Returns the long format codes (for -l flag).
55+ pub ( crate ) fn long_format_codes ( ) -> Vec < String > {
56+ [
57+ "f" , "s" , "uid" , "pid" , "ppid" , "c" , "pri" , "ni" , "addr" , "sz" , "wchan" , "tname" , "time" ,
58+ "ucmd" ,
59+ ]
60+ . map ( Into :: into)
61+ . to_vec ( )
62+ }
63+
64+ /// Returns the modified long format codes (for -ly flags).
65+ pub ( crate ) fn long_y_format_codes ( ) -> Vec < String > {
66+ [
67+ "s" , "uid" , "pid" , "ppid" , "c" , "pri" , "ni" , "rss" , "sz" , "wchan" , "tname" , "time" , "ucmd" ,
68+ ]
69+ . map ( Into :: into)
70+ . to_vec ( )
71+ }
72+
5473/// Returns the default codes with PSR column (for -P flag).
5574pub ( crate ) fn default_with_psr_codes ( ) -> Vec < String > {
5675 [ "pid" , "psr" , "tname" , "time" , "ucmd" ]
@@ -85,6 +104,15 @@ pub(crate) fn vm_format_codes() -> Vec<String> {
85104 . to_vec ( )
86105}
87106
107+ /// Returns the register format codes (for -X flag).
108+ pub ( crate ) fn register_format_codes ( ) -> Vec < String > {
109+ [
110+ "pid" , "stackp" , "esp" , "eip" , "tmout" , "alarm" , "stat" , "tname" , "time" , "command" ,
111+ ]
112+ . map ( Into :: into)
113+ . to_vec ( )
114+ }
115+
88116/// Collect mapping from argument
89117pub ( crate ) fn default_mapping ( ) -> HashMap < String , String > {
90118 let mut mapping = HashMap :: new ( ) ;
@@ -100,8 +128,10 @@ pub(crate) fn default_mapping() -> HashMap<String, String> {
100128 append ( "_right2" , "R2R2R2R2" ) ;
101129 append ( "_unlimited" , "U" ) ;
102130 append ( "_unlimited2" , "U2" ) ;
131+ append ( "addr" , "ADDR" ) ; // undocumented
103132 append ( "ag_id" , "AGID" ) ;
104133 append ( "ag_nice" , "AGNI" ) ;
134+ append ( "alarm" , "ALARM" ) ; // undocumented
105135 append ( "args" , "COMMAND" ) ;
106136 append ( "atime" , "TIME" ) ;
107137 append ( "blocked" , "BLOCKED" ) ;
@@ -259,6 +289,7 @@ pub(crate) fn default_mapping() -> HashMap<String, String> {
259289 append ( "time" , "TIME" ) ;
260290 append ( "timens" , "TIMENS" ) ;
261291 append ( "times" , "TIME" ) ;
292+ append ( "tmout" , "TMOUT" ) ; // undocumented
262293 append ( "tname" , "TTY" ) ;
263294 append ( "tpgid" , "TPGID" ) ;
264295 append ( "trs" , "TRS" ) ;
0 commit comments