This is the cmd Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 17:42:46 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cmd
A utility for running external programs
Paul M. Rodriguez <pmr@ruricolist.com>
MIT
0.0.1
cmd/cmd
(system).
cmd/cmd
Paul M. Rodriguez <pmr@ruricolist.com>
MIT
alexandria
(system).
serapeum
(system).
cmd/hooks
(system).
trivia
(system).
shlex
(system).
trivial-garbage
(system).
cmd/hooks
Paul M. Rodriguez <pmr@ruricolist.com>
MIT
alexandria
(system).
serapeum
(system).
Files are sorted by type and then listed depth-first from the systems components trees.
cmd/cmd/file-type.lisp
cmd/cmd
(system).
$cmd
(compiler macro).
$cmd
(function).
$sh
(function).
*cmd-env*
(special variable).
*cmd-path*
(special variable).
*command-wrappers*
(special variable).
*null-error-output*
(special variable).
*null-output*
(special variable).
*shell*
(special variable).
*terminal*
(special variable).
*visual-commands*
(special variable).
cmd
(compiler macro).
cmd
(function).
cmd
(class).
cmd!
(compiler macro).
cmd!
(function).
cmd&
(compiler macro).
cmd&
(function).
cmd-error
(condition).
cmd-error-stderr
(reader method).
cmd?
(compiler macro).
cmd?
(function).
current-directory
(function).
(setf current-directory)
(function).
initialize-instance
(method).
make-load-form
(method).
print-object
(method).
print-object
(method).
psub
(compiler macro).
psub
(function).
psub
(class).
psub-echo
(function).
psub-echo
(class).
psub-format
(compiler macro).
psub-format
(function).
sh
(function).
sh!
(function).
sh&
(function).
sh?
(function).
vterm-terminal
(function).
with-cmd-dir
(macro).
with-working-directory
(macro).
%constructor=
(method).
*can-use-env-c*
(special variable).
*subprocs*
(special variable).
+dividers+
(symbol macro).
+env+
(symbol macro).
+kill+
(symbol macro).
+ps+
(symbol macro).
+pwd+
(symbol macro).
+redirection-operators+
(symbol macro).
+sh+
(symbol macro).
+storage-for-deflex-var-+redirection-operators++
(constant).
+storage-for-deflex-var-+subcommand-dividers++
(constant).
+subcommand-dividers+
(symbol macro).
+tr+
(symbol macro).
argv+kwargs
(function).
as-shell
(function).
await
(function).
call/cmd-dir
(function).
call/stderr-file
(function).
can-use-env-c?
(function).
cmd-argv
(reader method).
cmd-env
(function).
cmd-kwargs
(reader method).
(setf cmd-kwargs)
(writer method).
cmdq
(compiler macro).
cmdq
(function).
constructor-values/generic
(method).
copy-string-token
(function).
define-cmd-variant
(macro).
exe-string
(function).
expand-keyword-aliases
(function).
expand-redirection-abbrev
(function).
flatten-string-tokens
(function).
get-stderr-output-stream-string
(function).
get-tmpfs
(function).
kill-process-group
(function).
kill-subprocs
(function).
launch-cmd
(function).
launch-pipeline
(function).
launch-program-in-dir
(function).
launch-program-in-dir*
(function).
launch-psubs
(function).
launch-substitution
(generic function).
make-string-token
(function).
maybe-visual-command
(function).
mktemp
(function).
override-default-output-and-error-output
(function).
parse-cmd
(function).
parse-cmd-args
(function).
parseable
(type).
psub-echo-string
(reader method).
psub-shell
(function).
read-only-struct-slot-names
(method).
redirection-operator
(type).
register-subproc
(function).
register-subprocs
(function).
resolve-dir
(function).
shell-arg
(function).
shq
(function).
simplify-cmd-args
(function).
split-cmd
(function).
split-pipeline
(function).
stage-pipeline
(function).
string-token
(function).
string-token
(structure).
string-token-string
(reader).
stringify-pathname
(function).
subcommand-divider
(type).
subprocs
(function).
(setf subprocs)
(function).
substitution
(class).
update-can-use-env-c
(function).
validate-env-var
(function).
visual-command-p
(function).
with-stderr-caching
(macro).
with-stderr-file
(macro).
wrap-cmd-env
(function).
wrap-with-dir
(function).
cmd/hooks/file-type.lisp
cmd/hooks
(system).
*message-hook*
(special variable).
*proc-hook*
(special variable).
Packages are listed by definition order.
cmd/hooks
alexandria
.
common-lisp
.
serapeum
.
*message-hook*
(special variable).
*proc-hook*
(special variable).
cmd/cmd
cmd
alexandria
.
cmd/hooks
.
common-lisp
.
serapeum
.
$cmd
(compiler macro).
$cmd
(function).
$sh
(function).
*cmd-env*
(special variable).
*cmd-path*
(special variable).
*command-wrappers*
(special variable).
*null-error-output*
(special variable).
*null-output*
(special variable).
*shell*
(special variable).
*terminal*
(special variable).
*visual-commands*
(special variable).
cmd
(compiler macro).
cmd
(function).
cmd
(class).
cmd!
(compiler macro).
cmd!
(function).
cmd&
(compiler macro).
cmd&
(function).
cmd-error
(condition).
cmd-error-stderr
(generic reader).
cmd?
(compiler macro).
cmd?
(function).
current-directory
(function).
(setf current-directory)
(function).
psub
(compiler macro).
psub
(function).
psub
(class).
psub-echo
(function).
psub-echo
(class).
psub-format
(compiler macro).
psub-format
(function).
sh
(function).
sh!
(function).
sh&
(function).
sh?
(function).
vterm-terminal
(function).
with-cmd-dir
(macro).
with-working-directory
(macro).
*can-use-env-c*
(special variable).
*subprocs*
(special variable).
+dividers+
(symbol macro).
+env+
(symbol macro).
+kill+
(symbol macro).
+ps+
(symbol macro).
+pwd+
(symbol macro).
+redirection-operators+
(symbol macro).
+sh+
(symbol macro).
+storage-for-deflex-var-+redirection-operators++
(constant).
+storage-for-deflex-var-+subcommand-dividers++
(constant).
+subcommand-dividers+
(symbol macro).
+tr+
(symbol macro).
argv+kwargs
(function).
as-shell
(function).
await
(function).
call/cmd-dir
(function).
call/stderr-file
(function).
can-use-env-c?
(function).
cmd-argv
(generic reader).
cmd-env
(function).
cmd-kwargs
(generic reader).
(setf cmd-kwargs)
(generic writer).
cmdq
(compiler macro).
cmdq
(function).
copy-string-token
(function).
define-cmd-variant
(macro).
exe-string
(function).
expand-keyword-aliases
(function).
expand-redirection-abbrev
(function).
flatten-string-tokens
(function).
get-stderr-output-stream-string
(function).
get-tmpfs
(function).
kill-process-group
(function).
kill-subprocs
(function).
launch-cmd
(function).
launch-pipeline
(function).
launch-program-in-dir
(function).
launch-program-in-dir*
(function).
launch-psubs
(function).
launch-substitution
(generic function).
make-string-token
(function).
maybe-visual-command
(function).
mktemp
(function).
override-default-output-and-error-output
(function).
parse-cmd
(function).
parse-cmd-args
(function).
parseable
(type).
psub-echo-string
(generic reader).
psub-shell
(function).
redirection-operator
(type).
register-subproc
(function).
register-subprocs
(function).
resolve-dir
(function).
shell-arg
(function).
shq
(function).
simplify-cmd-args
(function).
split-cmd
(function).
split-pipeline
(function).
stage-pipeline
(function).
string-token
(function).
string-token
(structure).
string-token-string
(reader).
stringify-pathname
(function).
subcommand-divider
(type).
subprocs
(function).
(setf subprocs)
(function).
substitution
(class).
update-can-use-env-c
(function).
validate-env-var
(function).
visual-command-p
(function).
with-stderr-caching
(macro).
with-stderr-file
(macro).
wrap-cmd-env
(function).
wrap-with-dir
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Alist of extra environment variables.
Extra directories to check for executables.
Commands that fire up other commands.
This list is used by ‘visual-command-p’ to check if the wrapped command is a
visual one.
See ‘*visual-commands*’.
Null device for standard error.
By binding this variable you can redirect error output that would otherwise be sent to the null device.
Null device for standard output.
By binding this variable you can redirect output that would otherwise be sent to the null device.
The shell to use for shell commands.
Defaults to $SHELL.
The terminal is either
- a list of arguments after which the visual command is appended,
- or a function of one argument, the list of commands, returning the new list of
commands.
See ‘*visual-commands*’.
List of commands that should be run in a ‘*terminal*’ emulator. Also see ‘*command-wrappers*’.
Deprecated; use ‘with-working-directory’ instead.
Run BODY with DIR as the current directory.
Calls to ‘cmd’ and its variants with the dynamic extent of the
‘with-working-directory’ form will use ‘dir’ as their working directory.
Return the results of CMD as a string, stripping any trailing
newlines, like $(cmd) would in a shell.
As a second value, return the error status.
By default stderr is discarded.
Like ‘$cmd’ for a shell command.
Takes a single argument (along with keyword arguments for redirection)
and passes it to a shell.
The shell defaults to the value of ‘cmd:*shell*’ (which in turn defaults to the value of SHELL in the environment).
Run a program.
CMD should be a string naming a program. This command will be run with
its current directory set to the value of the current directory in a
thread-safe manner.
The current directory is based on ‘*default-pathname-defaults*’, not on the OS-level working directory, as the OS-level directory is useless for multi-threaded programs.
A list of strings or pathnames is added to the list of arguments.
A string in ARGS is split into a list of tokens using shell-style
tokenization rules. (To protect a string with spaces, either add
quotation marks, or enclose it in a singleton list.)
A pathname in ARGS is translated to a native namestring and passed as
an argument to the command. The native namestring is not permitted to
start with a dash.
A property list is treated as a list of keyword arguments to
‘uiop:launch-program’. Certain keywords are treated as abbreviations:
e.g. ‘:>’ is an abbreviation for ‘:output’. Abbreviations can be
compound: e.g. ‘:>>’ affects both ‘:output’ and ‘:if-exists’.
By default, standard output is sent to ‘*standard-output*’, and error
output is sent to ‘*message-stream*’.
On Windows, the .exe suffix may be omitted from the name of the
executable.
Run CMD purely for its side effects, discarding all output and returning nothing.
Like ‘cmd’, but run asynchronously and return a handle on the process (as from ‘launch-program’).
Run a program, returning T if it passed, nil otherwise.
By default the output is discarded.
Returns the actual exit code as a second value.
Get the absolute current directory based on ‘*default-pathname-defaults*’.
Allow passing STRING to a command that expects a file.
This is practically equivalent to
(psub "echo" (list string))
Except that it doesn’t actually launch an external program.
Format ARGS using CONTROL-STRING and pass the result as a file to
the enclosing command.
This is practically equivalent to
(psub "echo" (list (format nil "?" control-string args))
Except that it doesn’t actually launch an external program.
Like ‘cmd’ for a shell command.
Takes a single argument (along with keyword arguments for redirection)
and passes it to a shell.
The shell defaults to the value of ‘cmd:*shell*’ (which in turn defaults to the value of SHELL in the environment).
Like ‘cmd!’ for a shell command.
Takes a single argument (along with keyword arguments for redirection)
and passes it to a shell.
The shell defaults to the value of ‘cmd:*shell*’ (which in turn defaults to the value of SHELL in the environment).
Like ‘cmd&’ for a shell command.
Takes a single argument (along with keyword arguments for redirection)
and passes it to a shell.
The shell defaults to the value of ‘cmd:*shell*’ (which in turn defaults to the value of SHELL in the environment).
Like ‘cmd?’ for a shell command.
Takes a single argument (along with keyword arguments for redirection)
and passes it to a shell.
The shell defaults to the value of ‘cmd:*shell*’ (which in turn defaults to the value of SHELL in the environment).
Run visual command CMD in Emacs’ ‘vterm’.
string-token
) &optional env) ¶string-token
) stream) ¶subprocess-error
.
Initarg | Value |
---|---|
:stderr |
|
:stderr
This slot is read-only.
A single subcommand, with argv and kwargs ready to pass to ‘uiop:launch-program’.
A process substitution.
A process substitution that just echoes a string.
Initarg | Value |
---|---|
:string | (error no string!) |
common-lisp
.
string
:string
This slot is read-only.
All redirection operators that can be parsed in tokenized strings.
All supported subcommand dividers (e.g. pipelines).
Save whether we can use env -C.
A table from process to subprocesses.
Parse ARGS and split them into an argv and keyword arguments.
Wait for PROC to finish.
Return T if we can use env -C to launch a program in the current directory, instead of using a shell.
Copy an instance of STRING-TOKEN, optionally overriding some or all of its slots.
Get a suitable tmpfs.
Terminate PROCESS and all its descendants.
On Unix, sends a TERM signal by default, or a KILL signal if URGENT.
Kill all subprocesses of PROC.
Auxiliary function for launching CMD with overrides.
Run a program (with ‘uiop:launch-program’) in the current base directory.
Launch any process substitutions in ARGV. Return two values: the new argv and a list of subprocesses (or other cleanup forms).
Create a temporary file for use with process substition. When possible use a tmpfs.
Override null output with ‘*null-output*’ and null error output with ‘*null-error-output*’.
Lex ARGs.
The result is a list of strings, subcommand dividers, and keyword
arguments.
Like ‘psub’ for a shell command.
Takes a single argument (along with keyword arguments for redirection)
and passes it to a shell.
The shell defaults to the value of ‘cmd:*shell*’ (which in turn defaults to the value of SHELL in the environment).
Register SUBPROC as a subprocess of PROC and return SUBPROC.
Register SUBPROC as a subprocess of PROC.
Resolve DIR into an absolute directory based on ‘*default-pathname-defaults*‘, supplemented with the OS-level working directory if that is not absolute.
Like ‘cmdq’ for a shell command.
Takes a single argument (along with keyword arguments for redirection)
and passes it to a shell.
The shell defaults to the value of ‘cmd:*shell*’ (which in turn defaults to the value of SHELL in the environment).
Simplify ARGS at compile time (for compiler macros).
Split ARGS into two values: the last command in the pipeline, and any previous commands.
Return CMDS as a single command that can be passed to ‘launch-pipeline’.
Check that NAME is a valid (portable) name for an environment variable.
Return true if the COMMAND list runs one of the programs in ‘*visual-commands*’.
‘*command-wrappers*’ are supported, i.e.
env FOO=BAR sudo -i powertop
works.
Wrap TOKENS with the necessary code to run the process in DIR.
The OS-level current directory is per-process, not per thread. Using ‘chdir’ could lead to race conditions. Instead, we arrange for the new process to change its own working directory.
Launch a command substitution.
Should always return two values, both lists:
1. A list of new arguments for the argv.
2. A list of cleanup forms.
string-token
) (o2 string-token
)) ¶serapeum
.
string-token
)) ¶serapeum
.
string-token
)) ¶serapeum
.
%read-only-struct
.
common-lisp
.
(simple-array character (*))
(alexandria:required-argument (quote string))
This slot is read-only.
Jump to: | $
%
(
A C D E F G I K L M O P R S U V W |
---|
Jump to: | $
%
(
A C D E F G I K L M O P R S U V W |
---|
Jump to: | *
+
A C K S |
---|
Jump to: | *
+
A C K S |
---|
Jump to: | C F P R S T |
---|
Jump to: | C F P R S T |
---|