-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
args_from_usage() has issues with non-ASCII identifiers #664
Comments
Originally the Thanks for taking the time to request and file this! 👍 |
This is a niche issue, and easy to work around. |
Why'd you ever fail when it can actually work though? |
Closes clap-rs#664 and should make it faster too.
This should also speeds up the parser (except maybe for short options). Multi-codepoint characters still can't be used as short options, but people shouldn't non-ASCII options nyway. Closes clap-rs#664
If it was difficult to make it work. I did it anyway. |
Handle non-ascii names / options in from_usage(). Closes #664 and should make it faster too. Why aren't the stop_at functions written like `c != a && c != b`?
Non-ASCII help on its own is OK:
clap::App::new("").args_from_usage("<h> 'with ŭnicode'");
worksIf the last character is non-ascii there are slice errors:
clap::App::new("").args_from_usage("<hæ> 'comment doesn't matter'");
If both name and help has non-ascii the program hangs:
clap::App::new("").args_from_usage("<øh> 'with ŭnicode'");
If only the name is non-ascii the argument is not detected:
clap::App::new("").args_from_usage("<øh> 'ASCII or empty'").get_matches().value_of("øh").unwrap()
The first three act the same with options, but this is different:
clap::App::new("").args_from_usage("--øh 'ASCII'").get_matches();
gives this error:Arg::with_name() has none of these issues.
The text was updated successfully, but these errors were encountered: