Skip to content

Commit ebdfef4

Browse files
committed
Broken: Refactor fish completions to use ToolInfoV0.
Signed-off-by: Ross Goldberg <[email protected]>
1 parent 6261015 commit ebdfef4

File tree

4 files changed

+136
-164
lines changed

4 files changed

+136
-164
lines changed

Sources/ArgumentParser/Completions/CompletionsGenerator.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ struct CompletionsGenerator {
144144
case .bash:
145145
return ToolInfoV0(commandStack: [command]).bashCompletionScript
146146
case .fish:
147-
return [command].fishCompletionScript
147+
return ToolInfoV0(commandStack: [command]).fishCompletionScript
148148
default:
149149
fatalError("Invalid CompletionShell: \(shell)")
150150
}
@@ -177,14 +177,6 @@ extension ParsableCommand {
177177
}
178178

179179
extension [ParsableCommand.Type] {
180-
var positionalArguments: [ArgumentDefinition] {
181-
guard let command = last else {
182-
return []
183-
}
184-
return ArgumentSet(command, visibility: .default, parent: nil)
185-
.filter(\.isPositional)
186-
}
187-
188180
/// Include default 'help' subcommand in nonempty subcommand list if & only if
189181
/// no help subcommand already exists.
190182
mutating func addHelpSubcommandIfMissing() {

0 commit comments

Comments
 (0)