Skip to content

Commit 8d8c4f9

Browse files
committed
feat(help): use whitespace instead of dot in display, fix #1281
1 parent 463b676 commit 8d8c4f9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugins/common/help/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@koishijs/plugin-help",
33
"description": "Help plugin for Koishi",
4-
"version": "2.3.3",
4+
"version": "2.4.0",
55
"main": "lib/index.js",
66
"typings": "lib/index.d.ts",
77
"files": [

plugins/common/help/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function formatCommands(path: string, session: Session<'authority'>, children: C
196196

197197
const prefix = session.resolve(session.app.config.prefix)[0] ?? ''
198198
const output = commands.map(({ name, displayName, config }) => {
199-
let output = ' ' + prefix + displayName
199+
let output = ' ' + prefix + displayName.replace(/\./g, ' ')
200200
output += ' ' + session.text([`commands.${name}.description`, ''], config.params)
201201
return output
202202
})
@@ -243,7 +243,7 @@ function getOptions(command: Command, session: Session<'authority'>, config: Hel
243243
}
244244

245245
async function showHelp(command: Command, session: Session<'authority'>, config: HelpOptions) {
246-
const output = [session.text('.command-title', [command.displayName + command.declaration])]
246+
const output = [session.text('.command-title', [command.displayName.replace(/\./g, ' ') + command.declaration])]
247247

248248
const description = session.text([`commands.${command.name}.description`, ''], command.config.params)
249249
if (description) output.push(description)

0 commit comments

Comments
 (0)