 (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]
+  [file-name search-link include-child-content?]
   (with-open [out-file (io/writer file-name)]
+    (let [get-texts-fn (if include-child-content?
+                         get-item-texts-with-children
+                         get-item-texts)]
     (csv/write-csv out-file
                    (cons ["document-url", "document-name", "document-text"]
-                         (get-item-texts search-link)))))
+                         (get-texts-fn 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)))

      (:help options) (exit 0 (usage summary))
      (not= (count arguments) 1) (exit 1 (usage summary))
      errors (exit 1 (error-msg errors)))
    (save-summitpost-search-results! (:file options)
                                     (first arguments)
                                     (:include-child-content options))))
