MCPcopy Index your code
hub / github.com/coder/coder / addOption

Method addOption

cli/configssh.go:76–97  ·  view source on GitHub ↗
(option string)

Source from the content-addressed store, hash-verified

74}
75
76func (o *sshConfigOptions) addOption(option string) error {
77 key, value, err := codersdk.ParseSSHConfigOption(option)
78 if err != nil {
79 return err
80 }
81 lowerKey := strings.ToLower(key)
82 if o.removedKeys != nil && o.removedKeys[lowerKey] {
83 // Key marked as removed, skip.
84 return nil
85 }
86 // Only append the option if it is not empty
87 // (we interpret empty as removal).
88 if value != "" {
89 o.sshOptions = append(o.sshOptions, option)
90 } else {
91 if o.removedKeys == nil {
92 o.removedKeys = make(map[string]bool)
93 }
94 o.removedKeys[lowerKey] = true
95 }
96 return nil
97}
98
99func (o sshConfigOptions) equal(other sshConfigOptions) bool {
100 if !slicesSortedEqual(o.sshOptions, other.sshOptions) {

Callers 1

addOptionsMethod · 0.95

Calls 1

ParseSSHConfigOptionFunction · 0.92

Tested by

no test coverage detected