(command *Command)
| 202 | } |
| 203 | |
| 204 | func commandAncestry(command *Command) string { |
| 205 | var ancestry []string |
| 206 | ancestors := command.Lineage() |
| 207 | for i := len(ancestors) - 2; i >= 0; i-- { |
| 208 | ancestry = append( |
| 209 | ancestry, |
| 210 | fmt.Sprintf( |
| 211 | "__fish_seen_subcommand_from %s", |
| 212 | strings.Join(ancestors[i].Names(), " "), |
| 213 | ), |
| 214 | ) |
| 215 | } |
| 216 | return strings.Join(ancestry, "; and ") |
| 217 | } |
| 218 | |
| 219 | func escapeSingleQuotes(input string) string { |
| 220 | return strings.ReplaceAll(input, `'`, `\'`) |
no test coverage detected