Skip to content

Commit

Permalink
getTez: Throw error for unexpected argument
Browse files Browse the repository at this point in the history
  • Loading branch information
harryttd committed Oct 19, 2023
1 parent 4987b4a commit 944dbcd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions getTez/getTez.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type GetTezArgs = {
time?: boolean
}

const parseCliArgs = (args: string | string[]) => {
const parseCliArgs = (args: string | string[]): GetTezArgs => {
if (typeof args === "string") args = args.split(" ")

const parsedArgs: GetTezArgs = {
Expand Down Expand Up @@ -116,7 +116,11 @@ const parseCliArgs = (args: string | string[]) => {
log(pkgJson.version)
process.exit(0)
default:
parsedArgs.address = arg || ""
if (!parsedArgs.address) {
parsedArgs.address = arg || ""
} else {
handleError(`Unexpected argument provided '${arg}'.`, DISPLAY_HELP)
}
break
}
}
Expand Down

0 comments on commit 944dbcd

Please sign in to comment.