22
33mod address;
44mod link;
5+ mod neighbour;
56
67#[ cfg( test) ]
78mod tests;
@@ -10,6 +11,8 @@ use std::io::IsTerminal;
1011
1112use iproute_rs:: { CliColor , CliError , OutputFormat , print_result_and_exit} ;
1213
14+ use crate :: neighbour:: NeighbourCommand ;
15+
1316use self :: { address:: AddressCommand , link:: LinkCommand } ;
1417
1518#[ tokio:: main( flavor = "current_thread" ) ]
@@ -55,9 +58,17 @@ async fn main() -> Result<(), CliError> {
5558 . action ( clap:: ArgAction :: SetTrue )
5659 . global ( true ) ,
5760 )
61+ . arg (
62+ clap:: Arg :: new ( "STATISTICS" )
63+ . short ( 's' )
64+ . help ( "Show object statistics" )
65+ . action ( clap:: ArgAction :: SetTrue )
66+ . global ( true ) ,
67+ )
5868 . subcommand_required ( true )
5969 . subcommand ( LinkCommand :: gen_command ( ) )
60- . subcommand ( AddressCommand :: gen_command ( ) ) ;
70+ . subcommand ( AddressCommand :: gen_command ( ) )
71+ . subcommand ( NeighbourCommand :: gen_command ( ) ) ;
6172
6273 let matches = app. get_matches_mut ( ) ;
6374
@@ -84,6 +95,10 @@ async fn main() -> Result<(), CliError> {
8495 matches. subcommand_matches ( AddressCommand :: CMD )
8596 {
8697 print_result_and_exit ( AddressCommand :: handle ( matches) . await , fmt) ;
98+ } else if let Some ( matches) =
99+ matches. subcommand_matches ( NeighbourCommand :: CMD )
100+ {
101+ print_result_and_exit ( NeighbourCommand :: handle ( matches) . await , fmt) ;
87102 } else {
88103 app. print_help ( ) ?;
89104 println ! ( ) ;
0 commit comments