File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44(import ../utils :prefix " " )
55(import ../date :as d )
6+ (import ../errors )
67(import ../contact/repository :as contacts_repository )
78
89(defn- to-csv-line [contact ]
3536 (let [load-result (contacts_repository/load-contacts argument )
3637 errors (load-result :errors )]
3738 (if errors
38- {:errors (format-command-errors " --list-contacts" errors )}
39+ {:errors (errors/ format-command-errors " --list-contacts" errors )}
3940 {:command [print-contacts (load-result :contacts )]}))
4041 {}))
Original file line number Diff line number Diff line change 11# ## ————————————————————————————————————————————————————————————————————————————————————————————————
22# ## This module implements a command for scheduling contacts for today in a plan.
33
4+ (import ../errors )
45(import ../utils :prefix " " )
56
67(import ../contact )
6970 errors (load-result :errors )
7071 contacts (load-result :contacts )]
7172 (if errors
72- {:errors (format-command-errors " --schedule-contacts" errors )}
73+ {:errors (errors/ format-command-errors " --schedule-contacts" errors )}
7374 {:command [schedule-contacts contacts (date/today )]}))
7475 {}))
Original file line number Diff line number Diff line change 88(import ../plan )
99(import ../task )
1010
11+ (import ../errors )
1112(import ../file_repository )
1213(import ../schedule_parser )
1314
8485 (let [load-file-result (file_repository/load argument )
8586 errors (load-file-result :errors )]
8687 (if errors
87- {:errors (format-command-errors command errors )}
88+ {:errors (errors/ format-command-errors command errors )}
8889 (let [parse-result (schedule_parser/parse (load-file-result :text ))
8990 errors (parse-result :errors )]
9091 (if errors
91- {:errors (format-command-errors command errors )}
92+ {:errors (errors/ format-command-errors command errors )}
9293 {:command [schedule-tasks (parse-result :tasks ) (date/today )]}))))
9394 {}))
Original file line number Diff line number Diff line change 1313(defn print-errors [errors exit-status-code ]
1414 (each error errors (print (string error " ." )))
1515 (os/exit exit-status-code ))
16+
17+ (defn format-command-errors [command errors ]
18+ (map (fn [error ] (string command " " (string/ascii-lower error ) " ." )) errors ))
Original file line number Diff line number Diff line change 1313 (if (string/has-suffix? " /" path )
1414 (string/trimr path " /" )
1515 path ))
16-
17- (defn format-command-errors [command errors ]
18- (map (fn [error ] (string command " " (string/ascii-lower error ) " ." )) errors ))
You can’t perform that action at this time.
0 commit comments