镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

disallow specifying multiple:true for boolean arguments - #92

Closed
bakkot wants to merge 1 commit into
pkgjs:mainfrom
bakkot:no-multiple-flags
Closed

bakkot wants to merge 1 commit into
pkgjs:mainfrom
bakkot:no-multiple-flags

Conversation

@bakkot

@bakkot bakkot commented Apr 10, 2022

Copy link
Copy Markdown
Collaborator

multiple allows you to collect all the values for string arguments into an array. It doesn't do anything for boolean arguments. Best disallow it, I would think?

@bakkot bakkot mentioned this pull request Apr 10, 2022
4 tasks done
@shadowspawn

Copy link
Copy Markdown
Collaborator

Collecting an array of string arguments is the main use case, but an array of booleans can be used as an indirect counting feature. The classic use case is more verbose, like -vvv.

It doesn't do anything for boolean arguments. Best disallow it, I would think?

I think it does do something and no need to disallow? I do think of the boolean usage as somewhat of a side-affect of the string array support rather than a "real" feature, but in the absence of explicit support for counting options (which is not a common enough use case to have made the feature set), I think multiple is usable for that purpose.

@bakkot

bakkot commented Apr 10, 2022

Copy link
Copy Markdown
Collaborator Author

Oh, sorry I missed that conversation. If it's intentional, I'll just change this to be a test, then.

@bakkot
bakkot deleted the no-multiple-flags branch April 10, 2022 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants