File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ mod errors;
1010#[ cfg( target_os = "linux" ) ]
1111mod smartcols;
1212
13- use clap:: { Command , crate_version} ;
13+ use clap:: { Arg , ArgAction , Command , crate_version} ;
1414#[ cfg( target_os = "linux" ) ]
1515use std:: ffi:: CString ;
1616#[ cfg( target_os = "linux" ) ]
@@ -88,7 +88,10 @@ struct Lsns {
8888
8989#[ uucore:: main]
9090pub fn uumain ( args : impl uucore:: Args ) -> UResult < ( ) > {
91- let _matches = uu_app ( ) . try_get_matches_from ( args) ?;
91+ let matches = uu_app ( ) . try_get_matches_from ( args) ?;
92+
93+ // Print no headings if this flag is set
94+ let noheadings = matches. get_flag ( "noheadings" ) ;
9295
9396 let mut lsns = Lsns {
9497 processes : Vec :: new ( ) ,
@@ -110,6 +113,13 @@ pub fn uu_app() -> Command {
110113 . about ( ABOUT )
111114 . override_usage ( format_usage ( USAGE ) )
112115 . infer_long_args ( true )
116+ . arg (
117+ Arg :: new ( "noheadings" )
118+ . short ( 'n' )
119+ . long ( "noheadings" )
120+ . action ( ArgAction :: SetTrue )
121+ . help ( "don't print headings" ) ,
122+ )
113123}
114124
115125/// Read information of all the processes from /proc
You can’t perform that action at this time.
0 commit comments