You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by sn...@apache.org on 2022/08/21 10:21:08 UTC

[nutch] branch master updated: NUTCH-2863 Injector to parse command-line flags case-insensitive

This is an automated email from the ASF dual-hosted git repository.

snagel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nutch.git


The following commit(s) were added to refs/heads/master by this push:
     new bec577d50 NUTCH-2863 Injector to parse command-line flags case-insensitive
bec577d50 is described below

commit bec577d50888e5e0ee448789851a04f01eb96e00
Author: Sebastian Nagel <sn...@apache.org>
AuthorDate: Wed Aug 17 15:59:24 2022 +0200

    NUTCH-2863 Injector to parse command-line flags case-insensitive
---
 src/java/org/apache/nutch/crawl/Injector.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/java/org/apache/nutch/crawl/Injector.java b/src/java/org/apache/nutch/crawl/Injector.java
index a3512f602..b93e8ca76 100644
--- a/src/java/org/apache/nutch/crawl/Injector.java
+++ b/src/java/org/apache/nutch/crawl/Injector.java
@@ -515,9 +515,9 @@ public class Injector extends NutchTool implements Tool {
         " -update   \tUpdate existing crawldb records with the injected records. Old metadata is preserved");
     System.err.println();
     System.err.println(
-        " -nonormalize\tDo not normalize URLs before injecting");
+        " -noNormalize\tDo not normalize URLs before injecting");
     System.err.println(
-        " -nofilter \tDo not apply URL filters to injected URLs");
+        " -noFilter \tDo not apply URL filters to injected URLs");
     System.err.println(
         " -filterNormalizeAll\n"
         + "           \tNormalize and filter all URLs including the URLs of existing CrawlDb records");
@@ -548,18 +548,18 @@ public class Injector extends NutchTool implements Tool {
     boolean filterNormalizeAll = false;
 
     for (int i = 2; i < args.length; i++) {
-      if (args[i].equals("-overwrite")) {
+      if (args[i].equalsIgnoreCase("-overwrite")) {
         overwrite = true;
-      } else if (args[i].equals("-update")) {
+      } else if (args[i].equalsIgnoreCase("-update")) {
         update = true;
-      } else if (args[i].equals("-noNormalize")) {
+      } else if (args[i].equalsIgnoreCase("-noNormalize")) {
         normalize = false;
-      } else if (args[i].equals("-noFilter")) {
+      } else if (args[i].equalsIgnoreCase("-noFilter")) {
         filter = false;
-      } else if (args[i].equals("-filterNormalizeAll")) {
+      } else if (args[i].equalsIgnoreCase("-filterNormalizeAll")) {
         filterNormalizeAll = true;
       } else {
-        LOG.info("Injector: Found invalid argument \"" + args[i] + "\"\n");
+        LOG.error("Injector: Found invalid argument \"{}\"", args[i]);
         usage();
         return -1;
       }