             [clojure.java.io :as io]
             [clojure.string :as string]
             [clojure.tools.cli :refer [parse-opts]]
-            [scrape-summitpost-data.get-item-texts :refer [get-item-texts]])
+            [scrape-summitpost-data.get-item-texts
+             :refer [get-item-texts get-item-texts-with-children]])
   (:gen-class))
 
 (def cli-options
   [["-f" "--file FILE" "File name for csv data"
     :default "data.csv"]
+   [nil
+    "--include-child-content"
+    (str "For each result, also include the content of all pages listed under "
+         "the 'Children' header in the left sidebar.")]
    ["-h" "--help"]])
 
 (defn usage [options-summary]

(defn save-summitpost-search-results!
  "Save a csv of item names and page texts for all search result items found
  at `search-link`."
  [file-name search-link]
  (with-open [out-file (io/writer file-name)]
    (csv/write-csv out-file
                   (cons ["document-url", "document-name", "document-text"]
                         (get-item-texts search-link)))))

(defn -main [& args]
  (let [{:keys [options arguments errors summary]} (parse-opts args cli-options)]

        options-summary
        ""
        "link: link (relative to summitpost domain) to a summitpost search"
        "      results page"
        "      e.g. /object_list.php?object_type=1&state_province_1=Washington&sort_select_1=object_name"
        ""]
       (string/join \newline)))
