mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Documentation and completion updates
darcs-hash:20051021123945-ac50b-3d3b5004fdf8424190cae84c7b27b2088c87c080.gz
This commit is contained in:
parent
a91c5fa86a
commit
6139df926b
7 changed files with 61 additions and 7 deletions
|
@ -5,8 +5,12 @@
|
|||
|
||||
\subsection function-description Description
|
||||
|
||||
- <tt>-d DESCRIPTION</tt> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description
|
||||
- \c -b or \c --key-binding specifies that the function is a key biding. Key binding functions work exactly like regular functions except that they can not be tab-completed, and may contain the '-' character.
|
||||
- <tt>-d DESCRIPTION</tt> or \c --description=DESCRIPTION is a description of what the function does, suitable as a completion description
|
||||
- <tt>-j PID</tt> or <tt> --on-job-exit PID</tt> tells fish to run this function when the job with group id PID exits
|
||||
- <tt>-p PID</tt> or <tt> --on-process-exit PID</tt> tells fish to run this function when the fish child process with process id PID exits
|
||||
- <tt>-s</tt> or <tt>--on-signal SIGSPEC</tt> tells fish to run this function when the signal SIGSPEC is delivered. SIGSPEC can be a singal number, or the signal name, such as SIGHUP (or just HUP)
|
||||
- <tt>-v</tt> or <tt>--on-variable VARIABLE_NAME</tt> tells fish to run this function when the variable VARIABLE_NAME changes value
|
||||
|
||||
This builtin command is used to create a new function. A Function is a
|
||||
list of commands that will be executed when the name of the function
|
||||
|
|
21
doc_src/psub.txt
Normal file
21
doc_src/psub.txt
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
\section psub psub - Perform process substitution
|
||||
|
||||
\subsection psub-synopsis Synopsis
|
||||
<tt>COMMAND1 (COMMAND2|psub) </tt>
|
||||
|
||||
\subsection psub-description Description
|
||||
|
||||
Posix shells feature a syntax that is a mix between command
|
||||
substitution and piping, called process substitution. It is used to
|
||||
send the output of a command into the calling command, much like
|
||||
command substitution, but with the difference that the output is not
|
||||
sent through commandline arguments but through a named pipe, with the
|
||||
filename of the named pipe sent as an argument to the calling
|
||||
program. The psub shellscript function, which when combined with a
|
||||
regular command substitution provides the same functionality.
|
||||
|
||||
\subsection psub-example Example
|
||||
|
||||
<tt>diff (sort a.txt|psub) (sort b.txt|psub)</tt> shows the difference
|
||||
between the sorted versions of files a.txt and b.txt.
|
|
@ -1,4 +1,7 @@
|
|||
complete -c function -s d -l description -d "Set function description" -x
|
||||
complete -c function -xa "(functions -n)" -d "Function"
|
||||
complete -c function -xa "(builtin -n)" -d "Builtin"
|
||||
|
||||
complete -c function -s j -l on-job-exit -d "Make the function a job exit event handler" -x
|
||||
complete -c function -s p -l on-process-exit -d "Make the function a process exit event handler" -x
|
||||
complete -c function -s s -l on-signal -d "Make the function a signal event handler" -x
|
||||
complete -c function -s v -l on-variable -d "Make the function a variable update event handler" -x
|
||||
|
|
2
init/completions/la.fish
Normal file
2
init/completions/la.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
complete -y ls
|
2
init/completions/ll.fish
Normal file
2
init/completions/ll.fish
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
complete -y ls
|
13
init/completions/ulimit.fish
Normal file
13
init/completions/ulimit.fish
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
complete -c ulimit -s a -l all -d "Set or get all current limits"
|
||||
complete -c ulimit -s c -l core-size -d "Maximum size of core files created"
|
||||
complete -c ulimit -s d -l data-size -d "Maximum size of a process’s data segment"
|
||||
complete -c ulimit -s f -l file-size -d "Maximum size of files created by the shell"
|
||||
complete -c ulimit -s l -l lock-size -d "Maximum size that may be locked into memory"
|
||||
complete -c ulimit -s m -l resident-set-size -d "Maximum resident set size"
|
||||
complete -c ulimit -s n -l file-descriptor-count -d "Maximum number of open file descriptors"
|
||||
complete -c ulimit -s s -l stack-size -d "Maximum stack size"
|
||||
complete -c ulimit -s t -l cpu-time -d "Maximum amount of cpu time in seconds"
|
||||
complete -c ulimit -s u -l process-count -d "Maximum number of processes available to a single user"
|
||||
complete -c ulimit -s v -l virtual-memory-size -d "Maximum amount of virtual memory available to the shell"
|
||||
complete -c ulimit -s h -l help -d "Display help and exit"
|
|
@ -921,8 +921,22 @@ function umask -d "Set default file permission mask"
|
|||
|
||||
end
|
||||
|
||||
|
||||
function psub -d "Read from stdin into a file and output the filename. Remove the file when the command that calles psub exits."
|
||||
|
||||
if count $argv >/dev/null
|
||||
switch $argv[1]
|
||||
case '-h*' --h --he --hel --help
|
||||
|
||||
help psub
|
||||
return 0
|
||||
|
||||
case '*'
|
||||
echo psub: Unknown argument $argv[1]
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
if not status --is-command-substitution
|
||||
echo psub: Not inside of command substitution
|
||||
return
|
||||
|
@ -958,9 +972,6 @@ function psub -d "Read from stdin into a file and output the filename. Remove th
|
|||
|
||||
end
|
||||
|
||||
|
||||
if status --is-interactive
|
||||
|
||||
function prevd-or-backward-word --key-binding
|
||||
if test -z (commandline)
|
||||
prevd
|
||||
|
@ -991,5 +1002,3 @@ function delete-or-exit --key-binding
|
|||
exit
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue