Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

feature request: repeated parameters

Open
#3 0 comments 1 reaction 1 assignee View on GitHub

@Sukairo-02 is already working on this.

Since Nov 3, 2024.

Assessment

This issue has not been assessed yet.

Description

it often makes sense to have the same argument repeated multiple times (both named and positional)

e.g. with arg it's possible to do something like this:

const args = arg({
  '--foo': [String]
} as const, { permissive: true })

console.log(args)

which would result in something like this:

$ node test.js --foo=1 --foo=2 1 2 3 4
{
  _: ['1', '2', '3', '4'],
  '--foo': ['1', '2'],
}

this is currently not possible with brocli however :c
the best workaround currently is to use e.g. comma delimiter and manually split them, which is obviously not ideal – you have to account for the comma being a part of one of the items, and it also looks awkward as positional args

my proposed api would look something like this:

const foo = command({
  name: 'foo',
  options: {
    foo: string().repeated(),
    bar: positional().repeated()
  },
  handler: console.log
})

which would print a similar output to the above

Dominant language
TypeScript
Stars
482
Forks
6
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from drizzle-team/brocli

All issues in drizzle-team/brocli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.