ssh_config icon indicating copy to clipboard operation
ssh_config copied to clipboard

UserSettings functions should have the same signature as Config

Open kke opened this issue 2 years ago • 2 comments

I can't do something like this:

type sshconfig interface {
  GetAll(alias, key string) ([]string, error)
}

var sshConfig sshconfig

func initSshConfig() {
  if path := os.Getenv("SSH_CONFIG"); path != "" {
    f, _ := os.Open(path)
    cfg, _ := ssh_config.Decode(f)
    sshConfig = c
    return
   }
   sshConfig = ssh_config.DefaultUserSettings
}

==>

		have GetAll(alias string, key string) []string
		want GetAll(alias string, key string) ([]string, error)

kke avatar Jan 24 '23 11:01 kke

~~I think I can use GetAllStrict~~ (no, ssh_config.Config does not have GetAllStrict)

kke avatar Jan 24 '23 11:01 kke

Actually, I think what I want to do is overwrite UserSettings.userConfig or UserSettings.configFinder.

The only exposed setting is IgnoreErrors.

Perhaps something like NewUserSettings(params).

edit a year later: i have no clue what i'm talking about in this comment.

kke avatar Jan 24 '23 12:01 kke