feature request: repeated parameters
@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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from drizzle-team/brocli
-
default command?May be free again @Sukairo-02 claimed this 672 days ago, and no pull request is open. Open
drizzle-team/brocli#6 · 2 comments · 3 reactions · 1 assignee ·
-
feature request: auto transform option namesMay be free again @Sukairo-02 claimed this 717 days ago, and no pull request is open. Open
drizzle-team/brocli#5 · 2 reactions · 1 assignee ·
-
feature request: dynamic defaultsMay be free again @Sukairo-02 claimed this 717 days ago, and no pull request is open. Open
drizzle-team/brocli#4 · 1 reaction · 1 assignee ·
All issues in drizzle-team/brocli
Similar issues
-
[BUG] rag: sentence content can cross the reported sentence boundariesPossibly taken @LJK-ikun claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
platformatic/mcp#361 ·
Maintainers usually reply within 1 day
-
frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Push: sem service worker ou sem VAPID, o interruptor de Notificações fica ligado sem avisar nadaOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
melgarafael/DeskcommCRM#3164 ·
Maintainers usually reply within 1 day