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
Use OS-native argument handling #1
Conversation
This fixes edge cases where the output file might have a non-UTF8 filename, this would panic when using `env::args`. It also uses the standard file_name method instead of an ad-hoc parsers for retrieving the program's command name in its help.
This doesn't actually fix everything. What I was hoping to achieve was to handle arguments such as: #!/bin/bash
echo hello > $'./\xff' # Okay, a valid file under Linux/ext4
echo hello | rewrite $'./\xff' # Currently:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "\xFF"', library/std/src/env.rs:772:51
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Instead, it now fails in
|
Hello @HeroicKatora and thanks for the PR. I'll take a look and see why getopts doesn't like this. |
I found a tracking issue: rust-lang/getopts#97 |
1 similar comment
This comment has been minimized.
This comment has been minimized.
It's crusty and old, and was causing problems preventing non-Unicode paths from being used as destinations. See rust-lang/getopts#97 Closes #1.
@HeroicKatora can you please try building from master with 2367be0? |
Works like a charm 👍 |
Awesome, thanks for confirming! |
Could you do a |
Done! You've been named in the release notes. |
This fixes edge cases where the output file might have a non-UTF8
filename, this would panic when using
env::args
. It also uses thestandard file_name method instead of an ad-hoc parsers for retrieving
the program's command name in its help.