diff --git a/tools/psl.1 b/tools/psl.1 index ccc85aad..a4c77ea7 100644 --- a/tools/psl.1 +++ b/tools/psl.1 @@ -42,12 +42,15 @@ show library version information \fB\-\-print\-info\fR print info about library builtin data .SH PUBLIC SUFFIX DATA -By default, `psl' will use built-in Public Suffix data. +By default, `psl' will use the latest available Public Suffix data. .br You can also direct it to use a different file: .TP +\fB\-\-use\-latest\-data\fR +use the latest available PSL data [default] +.TP \fB\-\-use\-builtin\-data\fR -use the builtin PSL data [default] +use the builtin PSL data .TP \fB\-\-load\-psl\-file\fR load PSL data from file diff --git a/tools/psl.c b/tools/psl.c index 2c5504e1..f11af1f5 100644 --- a/tools/psl.c +++ b/tools/psl.c @@ -45,7 +45,8 @@ static void usage(int err, FILE* f) fprintf(f, "\n"); fprintf(f, "Options:\n"); fprintf(f, " --version show library version information\n"); - fprintf(f, " --use-builtin-data use the builtin PSL data [default]\n"); + fprintf(f, " --use-latest-data use the latest PSL data available [default]\n"); + fprintf(f, " --use-builtin-data use the builtin PSL data\n"); fprintf(f, " --load-psl-file load PSL data from file\n"); fprintf(f, " --is-public-suffix check if domains are public suffixes [default]\n"); fprintf(f, " --is-cookie-domain-acceptable \n"); @@ -92,6 +93,15 @@ int main(int argc, const char *const *argv) mode = 4; cookie_domain = *(++arg); } + else if (!strcmp(*arg, "--use-latest-data")) { + psl_free(psl); + if (psl_file) { + fprintf(stderr, "Dropped data from %s\n", psl_file); + psl_file = NULL; + } + if (!(psl = (psl_ctx_t *) psl_latest(NULL))) + printf("No PSL data available\n"); + } else if (!strcmp(*arg, "--use-builtin-data")) { psl_free(psl); if (psl_file) {