Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/ArgumentParser/Usage/HelpGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ extension NameSpecification {
case .long(let helpName):
return .long("\(helpName)-\(visibility.base)")
case .longWithSingleDash(let helpName):
return .longWithSingleDash("\(helpName)-\(visibility)")
return .longWithSingleDash("\(helpName)-\(visibility.base)") // Fix: use .base for consistency with .long case

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the comment here – it makes sense in the context of this PR, but not when reading the code by itself.

Suggested change
return .longWithSingleDash("\(helpName)-\(visibility.base)") // Fix: use .base for consistency with .long case
return .longWithSingleDash("\(helpName)-\(visibility.base)")

case .short:
// Cannot create a non-default help flag from a short name.
return nil
Expand Down
Loading