OPENDAP/libdap4

getdap4 some options not work

sungguoshuai opened this issue · 3 comments

I compiled the latest code with commit f80b36f .

I found getdap4 -i option not print server version and -k option not work ,here is the output:

$ ./getdap4 -i https://remotetest.unidata.ucar.edu/d4ts/
<html>
<head>
<title>DAP4 Test Files</title>
<meta http-equiv="Content-Type" content="text/html">
</meta>
...
<hr>
</html>

$ ./getdap4 -k https://remotetest.unidata.ucar.edu/d4ts/
Usage: /root/libdap4/.libs/lt-getdap4
 [dD vVikmzstM][-c <expr>][-m <num>] <url> [<url> ...] | <file> [<file> ...]
...
Options:
        d: For each URL, get the (DAP4) DMR object. Does not get data.
        D: For each URL, get the DAP4 Data response.

        v: Verbose output.
        V: Version of this client; see 'i' for server version.
        i: For each URL, get the server version.
        m: Request the same URL <num> times.
        z: Ask the server to compress data.
        s: Print Sequences using numbered rows.
        M: Assume data read from a file has no MIME headers; use only with files

        c: <expr> is a constraint expression. Used with -d/D
           NB: You can use a `?' for the CE also.
        S: Used in conjunction with -d and will report the total size of the data referenced in the DMR.
$

I noticed the related codes are commented in main function, any plan to fix these options?

-i option commented code:

libdap4/getdap4.cc

Lines 445 to 451 in f80b36f

#if 0
else if (get_version) {
fprintf(stderr, "DAP version: %s, Server version: %s\n",
url->request_protocol().c_str(),
url->get_version().c_str());
}
#endif

-k option commented code:

libdap4/getdap4.cc

Lines 258 to 262 in f80b36f

#if 0
case 'k':
dods_keep_temps = 1;
break; // keep_temp is in Connect.cc
#endif

I find the -k and -t options are commented in usage function 5170709, are these options invalid now?

I looked at these options and realized they were carried over from the DAP2 version of this command (getdap) and they don't make much sense for the DAP4 client side implementation that we are using. I removed -i and -k and also -t. I've push those changes to master.

If you think those options are important for work you're doing, please let me know and I'll look at the D4Connect code and see how I can add them back.