Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ and
.Dt MATH.MULTIPLY 9
.Os
.Sh NAME
.Nm "math multiply"
.Nm "math multiply" ,
.Nm mul
Comment thread
qflen marked this conversation as resolved.
.Nd "Print the product of the values."
.Sh SYNOPSIS
.Nm
Expand Down Expand Up @@ -150,7 +151,8 @@ and
.Dt MATH.STATS.AVERAGE 9
.Os
.Sh NAME
.Nm "math stats average"
.Nm "math stats average" ,
.Nm avg
.Nd "Print the average of the values."
.Sh SYNOPSIS
.Nm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Show the version.
.It Fl h , -help
Show help information.
.El
.It Em multiply
.It Em "multiply, mul"
Print the product of the values.
.Bl -tag -width 6n
.It Fl x , -hex-output
Expand All @@ -47,7 +47,7 @@ Calculate descriptive statistics.
Show the version.
.It Fl h , -help
Show help information.
.It Em average
.It Em "average, avg"
Print the average of the values.
.Bl -tag -width 6n
.It Fl -kind Ar kind
Expand Down
10 changes: 9 additions & 1 deletion Tools/generate-manual/DSL/Name.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ struct Name: MDocComponent {
var command: CommandInfoV0

var body: MDocComponent {
let names = [command.manualPageName] + (command.aliases ?? [])
Section(title: "name") {
MDocMacro.DocumentName(name: command.manualPageName)
for (index, name) in names.enumerated() {
if index < names.count - 1 {
MDocMacro.DocumentName(name: name)
.withUnsafeChildren(nodes: [","])
} else {
MDocMacro.DocumentName(name: name)
}
}
if let abstract = command.abstract {
MDocMacro.DocumentDescription(description: abstract)
}
Expand Down
3 changes: 2 additions & 1 deletion Tools/generate-manual/DSL/SinglePageDescription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ struct SinglePageDescription: MDocComponent {

for subcommand in command.subcommands ?? [] {
MDocMacro.ListItem(
title: MDocMacro.Emphasis(arguments: [subcommand.commandName]))
title: MDocMacro.Emphasis(
arguments: [subcommand.manualPageSubcommandLabel]))
SinglePageDescription(command: subcommand, root: false).core
}
}
Expand Down
5 changes: 5 additions & 0 deletions Tools/generate-manual/Extensions/ArgumentParser+MDoc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ extension CommandInfoV0 {
let parts = (superCommands ?? []) + [commandName]
return parts.joined(separator: " ")
}

var manualPageSubcommandLabel: String {
guard let aliases = aliases, !aliases.isEmpty else { return commandName }
return ([commandName] + aliases).joined(separator: ", ")
}
}

extension ArgumentInfoV0 {
Expand Down
Loading