Browse Source

import-notice: Fix command-line flags

Short options don't like spaces though, for whatever reason.
Chimo 11 months ago
parent
commit
42cdea547a
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      scripts/import-notices.php

+ 7
- 7
scripts/import-notices.php View File

@@ -3,20 +3,20 @@
3 3
 
4 4
 define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../../..'));
5 5
 
6
-require_once INSTALLDIR . '/scripts/commandline.inc';
7
-
8
-$longoptions = array('since', 'batchsize');
9
-$shortoptions = 's:b';
6
+$longoptions = array('since==', 'batchsize==');
7
+$shortoptions = 's::b::';
10 8
 
11 9
 $helptext = <<<END_OF_HELP
12 10
 import-notices.php [options]
13 11
 Import notices missing from the elastic search index.
14 12
 
15
-    -s --since  Start at a specific notice id
13
+    -s --since      Start at a specific notice id
16 14
     -b --batchsize  How many notices to send to ES at one time
17 15
 
18 16
 END_OF_HELP;
19 17
 
18
+require_once INSTALLDIR . '/scripts/commandline.inc';
19
+
20 20
 $since = get_option_value('s', 'since');
21 21
 $batchSize = get_option_value('b', 'batchsize');
22 22
 
@@ -69,7 +69,7 @@ do {
69 69
     $response = $engine->bulkImportNotices($notices, $indexName);
70 70
 
71 71
     $lastId = end($notices)->id;
72
-    echo "Last idz: $lastId\n";
72
+    echo "Last id: $lastId\n";
73 73
 
74 74
     // Collect some stats (skipped, (un)successful import)
75 75
     foreach($response['items'] as $item) {
@@ -81,7 +81,7 @@ do {
81 81
     }
82 82
 
83 83
     $index++;
84
-} while(count($notices) > 0) ;
84
+} while(count($notices) > 0);
85 85
 
86 86
 foreach($statuses as $status => $count) {
87 87
     switch($status) {

Loading…
Cancel
Save