@@ -33,7 +33,7 @@ pub fn invoke_get(input: Option<&String>, setting: &Setting) -> Result<Map<Strin
3333 match * setting {
3434 Setting :: SshdConfig => {
3535 let cmd_info = build_command_info ( input, true ) ?;
36- get_sshd_settings ( & cmd_info)
36+ get_sshd_settings ( & cmd_info, true )
3737 } ,
3838 Setting :: WindowsGlobal => {
3939 get_default_shell ( ) ?;
@@ -102,12 +102,12 @@ fn get_default_shell() -> Result<(), SshdConfigError> {
102102///
103103/// # Arguments
104104///
105- /// * `cmd_info` - CommandInfo struct containing optional filters, metadata, and includeDefaults flag.
105+ /// * `cmd_info` - ` CommandInfo` struct containing optional filters, metadata, and includeDefaults flag.
106106///
107107/// # Errors
108108///
109109/// This function will return an error if it cannot retrieve the sshd settings.
110- pub fn get_sshd_settings ( cmd_info : & CommandInfo ) -> Result < Map < String , Value > , SshdConfigError > {
110+ pub fn get_sshd_settings ( cmd_info : & CommandInfo , is_get : bool ) -> Result < Map < String , Value > , SshdConfigError > {
111111 let sshd_config_text = invoke_sshd_config_validation ( cmd_info. sshd_args . clone ( ) ) ?;
112112 let mut result = parse_text_to_map ( & sshd_config_text) ?;
113113 let mut inherited_defaults: Vec < String > = Vec :: new ( ) ;
@@ -161,7 +161,7 @@ pub fn get_sshd_settings(cmd_info: &CommandInfo) -> Result<Map<String, Value>, S
161161 if cmd_info. metadata . filepath . is_some ( ) {
162162 result. insert ( "_metadata" . to_string ( ) , serde_json:: to_value ( cmd_info. metadata . clone ( ) ) ?) ;
163163 }
164- if cmd_info. include_defaults {
164+ if cmd_info. include_defaults && is_get {
165165 result. insert ( "_inheritedDefaults" . to_string ( ) , serde_json:: to_value ( inherited_defaults) ?) ;
166166 }
167167 Ok ( result)
0 commit comments