Skip to content

Commit

Permalink
Add missing command checker
Browse files Browse the repository at this point in the history
  • Loading branch information
xach committed Nov 18, 2016
1 parent 24b7aa8 commit 7634052
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions upstream.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,20 @@

(defun random-of-type (type)
(random-element (coerce (all-of-type type) 'vector)))

(defgeneric command (source)
(:method (source)
nil))

(defun missing-commands ()
(let ((missing '())
(tried (make-string-table)))
(map-sources
(lambda (source)
(let ((command (command source)))
(when command
(unless (gethash command tried)
(setf (gethash command tried) t)
(unless (ignore-errors (run command "--version"))
(push command missing)))))))
missing))

0 comments on commit 7634052

Please sign in to comment.