splitKey splits `key`, which is part of a gitconfig key, into the refgroup symbol to which it applies and the field name within that section.
(key string)
| 151 | // refgroup symbol to which it applies and the field name within that |
| 152 | // section. |
| 153 | func splitKey(key string) (sizes.RefGroupSymbol, string) { |
| 154 | i := strings.LastIndexByte(key, '.') |
| 155 | if i == -1 { |
| 156 | return "", key |
| 157 | } |
| 158 | return sizes.RefGroupSymbol(key[:i]), key[i+1:] |
| 159 | } |
| 160 | |
| 161 | // AddRefopts adds the reference-related options to `flags`. |
| 162 | func (rgb *RefGroupBuilder) AddRefopts(flags *pflag.FlagSet) { |
no test coverage detected