Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.
Open
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
2 changes: 2 additions & 0 deletions src/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface IArg<T = string> {
parse?: ParseFn<T>
default?: T | (() => T)
options?: string[]
stopParsing?: boolean
}

export interface ArgBase<T> {
Expand All @@ -18,6 +19,7 @@ export interface ArgBase<T> {
default?: T | (() => T)
input?: string
options?: string[]
stopParsing?: boolean
}

export type RequiredArg<T> = ArgBase<T> & {
Expand Down
4 changes: 4 additions & 0 deletions src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ export class Parser<T extends ParserInput, TFlags extends OutputFlags<T['flags']
const arg = this.input.args[this._argTokens.length]
if (arg) arg.input = input
this.raw.push({type: 'arg', input})
if (arg && arg.stopParsing) {
parsingFlags = false
continue
}
}
const argv = this._argv()
const args = this._args(argv)
Expand Down