Skip to content

Commit

Permalink
feat(help): use whitespace instead of dot in display, fix #1281
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Nov 23, 2023
1 parent 463b676 commit 8d8c4f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/common/help/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@koishijs/plugin-help",
"description": "Help plugin for Koishi",
"version": "2.3.3",
"version": "2.4.0",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions plugins/common/help/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function formatCommands(path: string, session: Session<'authority'>, children: C

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

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

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

0 comments on commit 8d8c4f9

Please sign in to comment.