Skip to content

argparse: handle --param=5 just like --param 5#293

Open
rmunn wants to merge 1 commit into
janet-lang:masterfrom
rmunn:equals-signs-in-argparse
Open

argparse: handle --param=5 just like --param 5#293
rmunn wants to merge 1 commit into
janet-lang:masterfrom
rmunn:equals-signs-in-argparse

Conversation

@rmunn

@rmunn rmunn commented Jun 12, 2026

Copy link
Copy Markdown

This copies getopt_long behavior, where either space or equals are valid separators between options and values.

This PR does not allow -p=5 since getopt doesn't allow equals signs in short options (at least, that's not documented). Passing values to short options still requires spaces. If equals signs between option and value are desirable in short options, it would be quite easy to add that later.

Fixes #292.

Copies getopt_long behavior, where either space or equals are valid
separators between options and values.

Does not allow `-p=5` since getopt doesn't allow equals signs in short
options. Passing values to short options still requires spaces.
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.

argparse suggestion: handle --thing=5 as well as --thing 5

1 participant