Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid splitting on hyphens in cmdline options #17

Merged
merged 2 commits into from
Jan 21, 2017

Conversation

mgeisler
Copy link
Owner

@mgeisler mgeisler commented Jan 19, 2017

This makes -- an illegal split point in order to avoid splitting a word like --foo-bar on the initial two hyphens. Fixes #14.

A single or double hyphen in the beginning of a word is not a valid
break-point.

Double hyphens often appear with in texts about long command-line
options such as --dry-run or --ignore-backups.

Fixes #14.
In order for a hyphen to be considered as a legal split point, we now
require it to be surrounded by alphanumeric characters. This avoids
using the initial hyphens in "--foo-bar" and all hyphens in "foo--bar"
and "foo(-)bar" as split points.
@mgeisler mgeisler merged commit 0416ca4 into master Jan 21, 2017
@mgeisler mgeisler deleted the hyphens-cmdline-options branch May 4, 2017 15:52
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.

1 participant