mirror of
https://gitlab.com/vindarel/ciel.git
synced 2026-01-30 12:22:52 -08:00
Developer utilities: add Quicksearch
This commit is contained in:
parent
6e4b6fca45
commit
82ca7b7ed8
4 changed files with 38 additions and 5 deletions
2
ciel.asd
2
ciel.asd
|
|
@ -105,9 +105,11 @@
|
|||
|
||||
;;;
|
||||
;;; User helpers.
|
||||
;;; ;TODO: we don't want these dependencies when we build a binary.
|
||||
;;;
|
||||
:named-readtables
|
||||
:clesh ;; shell pass-through
|
||||
:quicksearch ;; search on GitHub, Cliki, Quickdocs.
|
||||
)
|
||||
:components ((:module "src"
|
||||
:components
|
||||
|
|
|
|||
|
|
@ -625,3 +625,31 @@ Learn more with:
|
|||
(arglist #'foo)
|
||||
;; (a b c &optional d)
|
||||
```
|
||||
|
||||
### Searching for libraries on GitHub, Quickdocs and Cliki (quicksearch)
|
||||
|
||||
We include
|
||||
[Quicksearch](https://github.com/lisp-maintainers/quicksearch), a
|
||||
simple search utility for Common Lisp libraries:
|
||||
|
||||
(qs:? "ciel" :u)
|
||||
|
||||
this will search on GitHub, Quickdocs and Cliki for "ciel", and it
|
||||
will print the URL of search results.
|
||||
|
||||
```
|
||||
SEARCH-RESULTS: "ciel"
|
||||
======================
|
||||
|
||||
Cliki
|
||||
-----
|
||||
cl-cron
|
||||
http://www.cliki.net/cl-cron
|
||||
|
||||
GitHub
|
||||
------
|
||||
CIEL
|
||||
https://github.com/ciel-lang/CIEL
|
||||
cl-cron
|
||||
https://github.com/lisp-mirror/cl-cron
|
||||
```
|
||||
|
|
|
|||
|
|
@ -243,11 +243,11 @@
|
|||
(t (apply fun (subseq args 0 l))))))
|
||||
|
||||
(defun handle-special-input (text)
|
||||
(let* ((splt (str:words text))
|
||||
(k (subseq (car splt) 1 (length (car splt))))
|
||||
(let* ((words (str:words text))
|
||||
(k (subseq (car words) 1 (length (car words))))
|
||||
(v (gethash k *special*)))
|
||||
(if v
|
||||
(call-special v (car splt) (cdr splt))
|
||||
(call-special v (car words) (cdr words))
|
||||
(format *error-output* "Unknown special command: ~a~%" k))))
|
||||
|
||||
(defun evaluate-lisp (text parsed)
|
||||
|
|
|
|||
|
|
@ -55,10 +55,13 @@
|
|||
else if (functionp program) return program))
|
||||
|
||||
(defun basename (arg)
|
||||
(when arg
|
||||
(namestring (pathname-name arg))))
|
||||
;; ARG can be any string. This fails with "(qs:?" (note the "?").
|
||||
(ignore-errors
|
||||
(when arg
|
||||
(namestring (pathname-name arg)))))
|
||||
|
||||
(defun shell-command-wrapper-p (command)
|
||||
"Is this command (string) a shell wrapper?"
|
||||
(find (basename command)
|
||||
*command-wrappers*
|
||||
:test #'string-equal))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue