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

Short flags without spaces #4

Open
rnewton opened this issue Mar 20, 2014 · 0 comments
Open

Short flags without spaces #4

rnewton opened this issue Mar 20, 2014 · 0 comments

Comments

@rnewton
Copy link

rnewton commented Mar 20, 2014

This library cannot parse short options passed without spaces between the flag and the value. For an example, I use cp:

$ touch testfile
$ mkdir testdir
$ cp testfile -ttestdir
$ ls testdir/
testfile

Where '-t' is the short option (to directory).

The current version of the library, given the same rule ('t'), will fail when it encounters the first letter of the parameter that doesn't have a corresponding rule. In this case, possibly 'e'. Additionally, the regex matching for a more complex case in the same vein will fail when any character other than a-z and '-' is encountered, such as a hostname or url. (-hexample.domain.com).

This is complicated by the fact that this is easy to apply to short flags that require a parameter. Optional parameters, however, would require additional checking to see if the current token is a listing of short flags or a short flag with parameter.

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

No branches or pull requests

1 participant