@@ -23,6 +23,9 @@ struct Cli {
23
23
#[ arg( long, short, action=ArgAction :: SetTrue ) ]
24
24
debug : bool ,
25
25
26
+ #[ arg( long, short, action=ArgAction :: SetTrue ) ]
27
+ diff : bool ,
28
+
26
29
#[ command( subcommand) ]
27
30
command : Commands ,
28
31
}
@@ -128,7 +131,9 @@ fn main() {
128
131
let diff_reply = netconf_session
129
132
. diff_configuration ( "text" . to_string ( ) )
130
133
. unwrap ( ) ;
131
- println ! ( "{}" , diff_reply) ;
134
+ if cli. diff {
135
+ println ! ( "{}" , diff_reply) ;
136
+ }
132
137
133
138
eprintln ! ( "Applying configuration..." ) ;
134
139
@@ -154,7 +159,9 @@ fn main() {
154
159
let diff_reply = netconf_session
155
160
. diff_configuration ( "text" . to_string ( ) )
156
161
. unwrap ( ) ;
157
- println ! ( "{}" , diff_reply) ;
162
+ if cli. diff {
163
+ println ! ( "{}" , diff_reply) ;
164
+ }
158
165
159
166
eprintln ! ( "Applying configuration..." ) ;
160
167
@@ -182,8 +189,9 @@ fn main() {
182
189
let diff_reply = netconf_session
183
190
. diff_configuration ( "text" . to_string ( ) )
184
191
. unwrap ( ) ;
185
- println ! ( "{}" , diff_reply) ;
186
-
192
+ if cli. diff {
193
+ println ! ( "{}" , diff_reply) ;
194
+ }
187
195
let _ = netconf_session. unlock_configuration ( ) . unwrap ( ) ;
188
196
}
189
197
}
0 commit comments