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

The option "/?" cannot be registered #34

Open
Zero3 opened this issue Mar 26, 2015 · 2 comments
Open

The option "/?" cannot be registered #34

Zero3 opened this issue Mar 26, 2015 · 2 comments

Comments

@Zero3
Copy link

Zero3 commented Mar 26, 2015

Trying to register the help command line option "/?" (which is common on the Windows platform) doesn't work. It silently gets translated to "-/". Is this a bug?

@Zero3 Zero3 changed the title Question marks doesn't work The option "/?" cannot be registered Mar 26, 2015
@lexicalscope
Copy link
Owner

This certainly sounds like a bug, I will take a look. Although feel free to
submit a patch if you can find the problem.

On Thu, Mar 26, 2015 at 7:30 PM, Zero3 [email protected] wrote:

Trying to register the help command line option "/?" (which is common on
the Windows platform) doesn't work. It silently gets translated to "-/". Is
this a bug?


Reply to this email directly or view it on GitHub
#34.

@Zero3
Copy link
Author

Zero3 commented Apr 7, 2015

I believe I found the reason:

The '-' is apparently prefixed shortName names (which I was passing my "/?" as).
The '/' is apparently because JewelCli blindly uses the first character of the provided String.

I'm not sure if this procedure is intended, but I see a couple of issues with the current approach:

  1. Short names must start with '-'. This is perfectly sensible in a Linux environment, but not so much for Windows where the '/' character is more common.

  2. JewelCli should not blindly throw away anything but the first character of a shortName. I would expect an exception.

  3. The signature for the shortName property is an array of String. This doesn't make much sense if everything but the first character is thrown away anyway. Should it have been an array of Character?

  4. On a related note, I attempted to use the longName property instead. It has a similar issue about prefixing "--", leading to the awkward "--/?" option. I assume this makes options like "/someoption" impossible with JewelCli?

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

2 participants