ambrevar/shell: Rename cmd<-> to cmd- and :<> to :-.

master
Pierre Neidhardt 2021-01-19 12:21:27 +01:00
parent 9d4f5d39cd
commit 36f48bd50b
1 changed files with 18 additions and 18 deletions

View File

@ -222,29 +222,29 @@ Example:
(when last-result-stream
(list :input last-result-stream)))))))))
(export-always 'cmd<->)
(defun cmd<-> (&rest args)
"Call `:<>'-separated commands in args, passing the result of one onto the next.
(export-always 'cmd-)
(defun cmd- (&rest args)
"Call `:-'-separated commands in args, passing the result of one onto the next.
Example:
(cmd<-> \"cat\" \".../share/hunspell/en_GB-large.dic\"
:<> \"sort\"
:<> \"uniq\" \"-c\"
:<> \"sort\" \"-nr\"
:<> \"head\" \"-3\")"
(apply #'%cmd<-> #'cmd:cmd args))
(cmd- \"cat\" \".../share/hunspell/en_GB-large.dic\"
:- \"sort\"
:- \"uniq\" \"-c\"
:- \"sort\" \"-nr\"
:- \"head\" \"-3\")"
(apply #'%cmd- #'cmd:cmd args))
(defun $cmd<-> (&rest args)
"Like `cmd<->' but return a string."
(apply #'%cmd<-> #'cmd:$cmd args))
(defun $cmd- (&rest args)
"Like `cmd-' but return a string."
(apply #'%cmd- #'cmd:$cmd args))
(defun cmd<->& (&rest args)
"Like `cmd<->' but return a `process-info' object."
(apply #'%cmd<-> #'cmd:cmd& args))
(defun cmd-& (&rest args)
"Like `cmd-' but return a `process-info' object."
(apply #'%cmd- #'cmd:cmd& args))
(defun cmd<->> (&rest args)
"Like `cmd<->' but return a stream."
(apply #'%cmd<-> #'cmd> args))
(defun cmd-> (&rest args)
"Like `cmd-' but return a stream."
(apply #'%cmd- #'cmd> args))
(export-always 'tee)
(defun tee (input-stream) ; TODO: Real `tee' with separate process.