Closed seisman closed 5 years ago
Are you sure? I just built the latest and it worked fine for me.
Did you open the local documentation or the remote one? If I remove my local documentation, gmt docs coast -R
opens https://docs.generic-mapping-tools.org/dev/coast.html#r for me, which is correct.
Sorry, it was the remote one. Going to beach, will look later.
On Win the local docs drop the #?
. That is
cmd /c start file:///C:/progs_cygw/GMTdev/gmt5/compileds/gmt6/VC14_64/share/doc/html/psxy.html#r
drops the #r
in the browser. Go figure why.
And how come that -Q works for you? It can't (and it doesn't). See sc of a debug session. print_url
remains false so it can't print the address.
Besides, 3 lines bellow it tests (GMT_OPT_INFILE = '<')
if (opt->option != GMT_OPT_INFILE) { /* This is not good */
EDIT: Sorry, before there was a opt = opt->next
.
So it's like it expects opt->option = 'Q'
to be in the linked list before opt->option = '>'
, but at least on Win it isn't.
And I finally saw my error
C:\v>gmt docs -Q plot
file:///C:/progs_cygw/GMTdev/gmt5/compileds/gmt6/VC14_64/share/doc/html/plot.html
this is not a good syntax. Why do we force it and lead dumb users do this mistake?
We require the -Q to be the first argument after program name docs otherwise it would get confused with -Q options in the modules.
Still not sure what you guys see:
pwessel@MacBeth:> gmt docs -Q coast -R
file:////Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/dbuild/gmt6/share/doc/html/coast.html#r
pwessel@MacBeth:> gmt docs -Q -S coast -R
https://docs.generic-mapping-tools.org/dev/coast.html#r
I also see that, but like I said above when sent to the browser the #r
is dropped.
Still regarding the order, why not?
if (opt->option == 'Q' || (opt->next && opt->next->option == 'Q'))
Well, we do opt = top->next and go back up so why check the next one when we do it in the loop?
Because the first time the loop runs, if it doesn't find -Q, it opens the browser right away. My idea would allow docs plot -Q -R
and docs -Q plot -R
but not docs plot -R -Q
.
Slippery slope to pass -Q to the module plot. So you would do gmt docs grdimage -Q -Q or just one -Q etc? What problem are we trying to solve here? People mixing up options and passing -Q to the module? Is this really a problem for us or the user?
Ok, had forgotten about program's -Q option (which do not work anyway). Going dinner.
You guys still have trouble? For me
pwessel@MacBeth:> gmt docs coast -R pwessel@MacBeth:> gmt docs -S coast -R
opens up coast at the -R description.
gmt docs -S coast -R
works, but gmt docs coast -R
still not.
gmt docs -Vd coast -R
says:
docs [DEBUG]: Opening file:////Users/seisman/local/GMT/share/doc/html/coast.html#r via open
but the URL showed in the opened browser is
file:///Users/seisman/local/GMT/share/doc/html/coast.html
It's not GMT. This doesn't work
cmd /c start file:///C:/progs_cygw/GMTdev/gmt5/compileds/gmt6/VC14_64/share/doc/html/psxy.html#r
``
Yes sorry, you are right. But
gmt docs -Vd coast -R ... docs [DEBUG]: Opening file:////Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/dbuild/gmt6/share/doc/html/coast.html#r via open
so what is happening to the #r in that URL? It is in the URL . OK @joa-quim says the same.
Yes, you're right.
open file:///Users/seisman/local/GMT/share/doc/html/coast.html#r
also doesn't work.
OK, I think the # marks a comment for the shell and it is skipped. Replacing # with %23 gives
pwessel@MacBeth:~/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/dbuild/gmt6/share/doc/html-> open file:////Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/dbuild/gmt6/share/doc/html/coast.html%23r The file //Users/pwessel/UH/RESEARCH/CVSPROJECTS/GMTdev/gmt-dev/dbuild/gmt6/share/doc/html/coast.html#r does not exist.
So a @seisman link points out, not supported.
So some choices here:
Since adding an option to a module only works for a true URL link, do we make server the default and replace -S with -L for local? If not, do we issue a warning when users supply an option without also using -S?
Since adding an option to a module only works for a true URL link, do we make server the default and replace -S with -L for local?
I prefer to keep the local one as the default, as it's much faster.
If not, do we issue a warning when users supply an option without also using -S?
agree.
I also prefer the local but we can have a mixed solution. if (-R) goWeb
Hm, yes I think that is a better solution. If you want to use local you don't give those options, else we force going to the server. OK with your @seisman ?
OK to me.
Closed as fixed.
The output with -Q is correct:
but
gmt docs coast -R
opensfile:///Users/seisman/local/GMT/share/doc/html/coast.html
without the trailing#r
.