-
Notifications
You must be signed in to change notification settings - Fork 382
Trouble with some shells like csh #3916
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
Comments
It's even worse. It fails not because the question mark is removed. When there is no match, the whole command fails without running the gmt command. |
Is it always true? Some projections (for example, -JS) say:
So command like below is allowed:
|
Right, so that would be -Js0/90//60 and pretty easy to detect. I think we we can pull it off, simply leaving the scale/width completely off, wherever it is, would be simpler for the users than any special character. |
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
Given the issues with csh discussed in #3916, this PR makes the questionmark optional. It even allows for a lack of final slash.
* Allow the ?-mark for unknow size to be optional Given the issues with csh discussed in #3916, this PR makes the questionmark optional. It even allows for a lack of final slash. * Update gmt_init.c * Implement the more conservative scheme when ? is not present Require a trailing / if at least one another argument, or otherwise have no numbers after the projection code. Adjusted the demonstration inset script and docs. added complement script that tests -JX without ?.
It seems that some shells like tcsh and csh will attempt to replace our inset/subset unknown projection width (e.g. -JM?) with a filename via UNIX wildcard expansion, as in this failure . However, unlike bash, zsh, if there is no match then csh will foolishly remove the question mark and GMT fails (as if all text on a commandline is a filename). Users can be told to turn off globbing or escape the question mark with a backslash, but neither are great options.
Looking at my code in gmt_init_module, it should be possible to simply leave off the unknown width without the ? place holder. This is because we have these situations only:
If we can get away with no specification, then ? can remain a backwards compatible way to do this (and it works fine for sensible shells), but we could move on and simply update the docs accordingly once we find this works.
The text was updated successfully, but these errors were encountered: