Skip to content

Commit 5e502c7

Browse files
committed
chore: merge upstream main and resolve conflicts
2 parents fa6f077 + cb5670a commit 5e502c7

24 files changed

+971
-402
lines changed

Sources/ArgumentParser/Completions/CompletionsGenerator.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ struct CompletionsGenerator {
138138
case .bash:
139139
return [command].bashCompletionScript
140140
case .fish:
141-
return FishCompletionsGenerator.generateCompletionScript(command)
141+
return [command].fishCompletionScript
142142
default:
143143
fatalError("Invalid CompletionShell: \(shell)")
144144
}
@@ -149,12 +149,13 @@ extension ArgumentDefinition {
149149
/// Returns a string with the arguments for the callback to generate custom completions for
150150
/// this argument.
151151
func customCompletionCall(_ commands: [ParsableCommand.Type]) -> String {
152-
let subcommandNames = commands.dropFirst().map { $0._commandName }.joined(
153-
separator: " ")
152+
let subcommandNames =
153+
commands.dropFirst().map { "\($0._commandName) " }.joined()
154154
let argumentName =
155155
names.preferredName?.synopsisString
156-
?? self.help.keys.first?.fullPathString ?? "---"
157-
return "---completion \(subcommandNames) -- \(argumentName)"
156+
?? self.help.keys.first?.fullPathString
157+
?? "---"
158+
return "---completion \(subcommandNames)-- \(argumentName)"
158159
}
159160
}
160161

0 commit comments

Comments
 (0)