Skip to content

Commit

Permalink
fix(koishi): cmd.parse() should respect fallback, fix #1437
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 7, 2024
1 parent 4dd30f2 commit 62332c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/src/command/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,12 @@ export namespace Argv {
return true
}

parse(argv: string | Argv, terminator?: string, args: any[] = [], options: Dict<any> = {}): Argv {
if (typeof argv === 'string') argv = Argv.parse(argv, terminator)
parse(argv: string | Argv, terminator?: string): Argv {
if (typeof argv === 'string') {
argv = Argv.parse(argv, terminator)
}
const args = argv.args || []
const options = { ...argv.options }

if (!argv.source && argv.tokens) {
argv.source = this.name + ' ' + Argv.stringify(argv)
Expand Down

0 comments on commit 62332c3

Please sign in to comment.