Skip to content

Some questions about kar command 🤔 #1382

Closed Answered by johnlindquist
alkene0005 asked this question in Errors
Discussion options

You must be logged in to vote

@alkene0005

await arg() will pull off the first arg passed in, then complete. So in your example, arg is immediately completing with the value "a".

You need to grab the args first, then clear them out:

import "@johnlindquist/kit"

let choices = args.map(x => x.toString())
args = []
await arg("Select", choices)

Make sense?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alkene0005
Comment options

Answer selected by alkene0005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Errors
Labels
None yet
2 participants