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

Catch erroneous substitutions of hyphen-minus with en dash #2332

Closed
civier opened this issue Jun 15, 2021 · 2 comments
Closed

Catch erroneous substitutions of hyphen-minus with en dash #2332

civier opened this issue Jun 15, 2021 · 2 comments

Comments

@civier
Copy link
Member

civier commented Jun 15, 2021

Right now, when a user erroneously use an en dash instead of the hyphen-minus (often when copying commands from other sources such as webpages), e.g.:

mrinfo –info image.nii.gz

The error message will be:

mrinfo: [ERROR] unknown format for image "–info"
mrinfo: [ERROR] error opening image "–info"

This can be extremely confusing to novice and advanced users alike (many terminals, e.g., Mac default's one, display hyphen-minus and en dash exactly the same).
I suggest to catch this, and display an appropriate error message, e.g.

mrinfo: [ERROR] en dash is probably used instead of hyphen-minus in "–info". If you try to specify a path that starts with en dash, please be aware that mrtrix3 does not allow this.

In the same opportunity, we should make files that start with en dash prohibited (the same way that files that start with hyphen-minus are), if this is not already the case.

The behaviour was confirmed when installing mrtrix3 using conda on 15/6/2021.

@jdtournier
Copy link
Member

Check out #2193 - that should sort out the problem, and probably goes quite a bit beyond what you're suggesting here. Not merged yet, but if there's demand we can try to prioritise it...

@jdtournier
Copy link
Member

closed with #2193

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants