Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserSettings functions should have the same signature as Config #55

Open
kke opened this issue Jan 24, 2023 · 2 comments
Open

UserSettings functions should have the same signature as Config #55

kke opened this issue Jan 24, 2023 · 2 comments

Comments

@kke
Copy link

kke commented Jan 24, 2023

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
Copy link
Author

kke commented Jan 24, 2023

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

@kke kke closed this as completed Jan 24, 2023
@kke kke reopened this Jan 24, 2023
@kke kke changed the title UserSettings functions should have the same signature as ssh.Config UserSettings functions should have the same signature as Config Jan 24, 2023
@kke
Copy link
Author

kke commented Jan 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant