<commit_before>;; Copyright (c) <NAME>. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.

(use 'clojure.tools.cli)
(require 'conexp.contrib.gui)
(require 'conexp.contrib.gui.repl-utils)
(require '[reply.main :as reply])

;;

(let [[options trailing doc] (cli *command-line-args*
                                  ["--gui"  "Start the graphical user interface"]
                                  ["--load" "Load a given script"]
                                  ["--help" "This help"])]
  ;;
  (when (contains? options :help)
    (println doc)
    (System/exit 0))
  ;;
  (when (contains? options :gui)
    (binding [conexp.contrib.gui.repl-utils/*main-frame*
              (conexp.contrib.gui/gui :default-close-operation :exit)]
      (reply/launch-standalone
       {:custom-eval '(do
                        (use 'conexp.main)
                        (use 'clojure.repl)
                        (require '[conexp.contrib.gui.repl-utils :as gui]))})))
  ;;
  (when (contains? options :load)
    (when (not (options :load))
      (println "Error: --load requires a file to load")
      (println doc)
      (System/exit 1))
    (load-file (options :load)))
  ;;
  (when-not (or (options :gui)
                (options :load))
    (reply/launch-standalone
     {:custom-eval '(do (use 'conexp.main) (use 'clojure.repl))})))

(System/exit 0)

;;

true<commit_msg>Cleaning up startup code<commit_after>;; Copyright (c) <NAME>. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.

(use 'clojure.tools.cli)
(require 'conexp.contrib.gui)
(require 'conexp.contrib.gui.repl-utils)
(require '[reply.main :as reply])

;;

(let [[options trailing doc] (cli *command-line-args*
                                  ["--gui"  "Start the graphical user interface"]
                                  ["--load" "Load a given script"]
                                  ["--help" "This help"])]
  (cond
    ;;
    (contains? options :help)
    (println doc)
    ;;
    (contains? options :gui)
    (binding [conexp.contrib.gui.repl-utils/*main-frame*
              (conexp.contrib.gui/gui :default-close-operation :exit)]
      (reply/launch-standalone
       {:custom-eval '(do
                        (use 'conexp.main)
                        (use 'clojure.repl)
                        (require '[conexp.contrib.gui.repl-utils :as gui]))}))
    ;;
    (contains? options :load)
    (do (when (not (options :load))
          (println "Error: --load requires a file to load")
          (println doc)
          (System/exit 1))
        (load-file (options :load)))
    ;;
    true
    (do (reply/launch-standalone
         {:custom-eval '(do (use 'conexp.main) (use 'clojure.repl))}))))

(System/exit 0)

;;

true
{'fraction_non_alphanumeric': 0.13799126637554585, 'fraction_numerical': 0.003784570596797671, 'mean_word_length': 2.2202436738519213, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4410160', 'n_tokens_mistral': 1057, 'n_tokens_neox': 1018, 'n_words': 327}