@@ -23,6 +23,9 @@ struct Cli {
2323 #[ arg( long, short, action=ArgAction :: SetTrue ) ]
2424 debug : bool ,
2525
26+ #[ arg( long, short, action=ArgAction :: SetTrue ) ]
27+ diff : bool ,
28+
2629 #[ command( subcommand) ]
2730 command : Commands ,
2831}
@@ -128,7 +131,9 @@ fn main() {
128131 let diff_reply = netconf_session
129132 . diff_configuration ( "text" . to_string ( ) )
130133 . unwrap ( ) ;
131- println ! ( "{}" , diff_reply) ;
134+ if cli. diff {
135+ println ! ( "{}" , diff_reply) ;
136+ }
132137
133138 eprintln ! ( "Applying configuration..." ) ;
134139
@@ -154,7 +159,9 @@ fn main() {
154159 let diff_reply = netconf_session
155160 . diff_configuration ( "text" . to_string ( ) )
156161 . unwrap ( ) ;
157- println ! ( "{}" , diff_reply) ;
162+ if cli. diff {
163+ println ! ( "{}" , diff_reply) ;
164+ }
158165
159166 eprintln ! ( "Applying configuration..." ) ;
160167
@@ -182,8 +189,9 @@ fn main() {
182189 let diff_reply = netconf_session
183190 . diff_configuration ( "text" . to_string ( ) )
184191 . unwrap ( ) ;
185- println ! ( "{}" , diff_reply) ;
186-
192+ if cli. diff {
193+ println ! ( "{}" , diff_reply) ;
194+ }
187195 let _ = netconf_session. unlock_configuration ( ) . unwrap ( ) ;
188196 }
189197 }
0 commit comments