Skip to content

Commit

Permalink
feat(koishi): fix regression of command alias args, fix #1437
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 13, 2024
1 parent 1f41c20 commit 29e8470
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/command/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ export class Commander {
if (!this.inferCommand(argv)) return
if (argv.tokens?.every(token => !token.inters.length)) {
const { options, args, error } = argv.command.parse(argv)
argv.options = { ...argv.options, ...options }
argv.args = [...argv.args || [], ...args]
argv.options = options
argv.args = args
argv.error = error
}
return argv.command
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/command/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ export namespace Argv {
if (typeof argv === 'string') {
argv = Argv.parse(argv, terminator)
}
const args = argv.args || []
const args = [...argv.args || []]
const options = { ...argv.options }

if (!argv.source && argv.tokens) {
Expand Down

0 comments on commit 29e8470

Please sign in to comment.