Skip to content

Commit

Permalink
Don't print out help for no input
Browse files Browse the repository at this point in the history
  • Loading branch information
lfranchi committed Mar 19, 2013
1 parent d036e1d commit 3ef8027
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ono/core.clj
Expand Up @@ -84,7 +84,7 @@
(for [k# (keys ~matches) :when (starts-with? ~input k#)] k#))]
((first (vals (select-keys ~matches matching-keys#)))
(rest (clojure.string/split ~input #" ")))
(~default)))
(~default ~input)))

;; Scanner
(defn- scan!
Expand All @@ -104,7 +104,7 @@
[input]
(parse-args input
:match-list {
"help" (fn [_] (println
"help" (fn [_] (println
"Supported commands:
help: Show this help message
Expand All @@ -113,8 +113,10 @@ numfiles: Return how many files are in the db
search \"track\" \"artist\": Search for a desired track/artist pair"))

"scan" (fn [args] (scan! (first args)))
"numfiles" (fn [_] (println (db/numfiles)))}
:default #(println "No such command!")))
"numfiles" (fn [_] (println (db/numfiles)))
}
:default #(when-not (= "" %)
(println "No such command!"))))

(defn -main [& args]
(setup! (constants-map))
Expand Down

0 comments on commit 3ef8027

Please sign in to comment.