@@ -34,6 +34,8 @@ pub struct ConfigV1 {
3434 pub post_hook_runner : Vec < String > ,
3535 #[ serde( default = "get_default_pre_hook_runner" ) ]
3636 pub pre_hook_runner : Vec < String > ,
37+ #[ serde( default = "get_default_post_hook_print_stdout" ) ]
38+ pub post_hook_print_stdout : bool ,
3739 #[ serde( default = "get_default_follow_symlinks" ) ]
3840 pub follow_symlinks : bool ,
3941}
@@ -110,6 +112,10 @@ fn get_default_pre_hook_runner() -> Vec<String> {
110112 Vec :: new ( )
111113}
112114
115+ fn get_default_post_hook_print_stdout ( ) -> bool {
116+ false
117+ }
118+
113119fn get_default_loop_separator ( ) -> String {
114120 DEFAULT_LOOP_SEPARATOR . to_string ( )
115121}
@@ -172,6 +178,25 @@ questions: {}"#;
172178 assert ! ( !cfg. follow_symlinks) ;
173179 }
174180
181+ #[ test]
182+ fn post_hook_print_stdout_defaults_false ( ) {
183+ let raw = r#"schemaVersion: v1
184+ questions: {}"# ;
185+ let config: Config = serde_yaml:: from_str ( raw) . expect ( "valid config" ) ;
186+ let Config :: V1 ( cfg) = config;
187+ assert ! ( !cfg. post_hook_print_stdout) ;
188+ }
189+
190+ #[ test]
191+ fn post_hook_print_stdout_parses_true ( ) {
192+ let raw = r#"schemaVersion: v1
193+ post_hook_print_stdout: true
194+ questions: {}"# ;
195+ let config: Config = serde_yaml:: from_str ( raw) . expect ( "valid config" ) ;
196+ let Config :: V1 ( cfg) = config;
197+ assert ! ( cfg. post_hook_print_stdout) ;
198+ }
199+
175200 #[ test]
176201 fn follow_symlinks_parses_true ( ) {
177202 let raw = r#"schemaVersion: v1
0 commit comments