add dump-everything debug aid
#include <stdio.h>
#include <string.h>
+void dumpAllVars() {
+ printf("VESPA_HOME = '%s'\n", vespa::Defaults::vespaHome());
+ std::string v = vespa::Defaults::underVespaHome("foo");
+ printf("underVespaHome(foo) = '%s'\n", v.c_str());
+ printf("VESPA_USER = '%s'\n", vespa::Defaults::vespaUser());
+ printf("VESPA_HOSTNAME = '%s'\n", vespa::Defaults::vespaHostname());
+ printf("web service port = %d\n", vespa::Defaults::vespaWebServicePort());
+ printf("VESPA_PORT_BASE = %d\n", vespa::Defaults::vespaPortBase());
+ printf("config server rpc port = %d\n", vespa::Defaults::vespaConfigServerRpcPort());
+ size_t count = 0;
+ for (std::string vv : vespa::Defaults::vespaConfigServerHosts()) {
+ ++count;
+ printf("config server host %zu = '%s'\n", count, vv.c_str());
+ }
+ count = 0;
+ for (std::string vv : vespa::Defaults::vespaConfigServerRestUrls()) {
+ ++count;
+ printf("config server rest URL %zu = '%s'\n", count, vv.c_str());
+ }
+ v = vespa::Defaults::vespaConfigProxyRpcAddr();
+ printf("config proxy RPC addr = '%s'\n", v.c_str());
+ printf("vespa version = '%s'\n", V_TAG_COMPONENT);
+}
+
int main(int argc, char **argv) {
if (argc != 2) {
fprintf(stderr, "usage: %s <variable>\n", argv[0]);
@@ -15,6 +39,8 @@ int main(int argc, char **argv) {
}
if (strcmp(argv[1], "home") == 0) {
printf("%s\n", vespa::Defaults::vespaHome());
+ } else if (strcmp(argv[1], "everything") == 0) {
+ dumpAllVars();
} else if (strcmp(argv[1], "user") == 0) {
printf("%s\n", vespa::Defaults::vespaUser());
} else if (strcmp(argv[1], "hostname") == 0) {
