(conditionals: ReadonlyArray<string>)
| 1181 | ) |
| 1182 | ) |
| 1183 | const subcommandCompletions = (conditionals: ReadonlyArray<string>) => |
| 1184 | Arr.map(info.subcommands, ([name, subcommand]) => { |
| 1185 | const description = getShortDescription(subcommand) |
| 1186 | return pipe( |
| 1187 | baseTemplate, |
| 1188 | Arr.appendAll(conditionals), |
| 1189 | Arr.appendAll(Arr.make("-f", "-a", `"${name}"`)), |
| 1190 | Arr.appendAll( |
| 1191 | description.length === 0 |
| 1192 | ? Arr.empty() |
| 1193 | : Arr.make("-d", `'${description}'`) |
| 1194 | ), |
| 1195 | Arr.join(" ") |
| 1196 | ) |
| 1197 | }) |
| 1198 | // If parent commands are empty, then the info is for the root command |
| 1199 | if (Arr.isEmptyReadonlyArray(info.parentCommands)) { |
| 1200 | const conditionals = Arr.make("-n", "\"__fish_use_subcommand\"") |
no test coverage detected