aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc_src/function.txt6
-rw-r--r--doc_src/psub.txt21
-rw-r--r--init/completions/function.fish5
-rw-r--r--init/completions/la.fish2
-rw-r--r--init/completions/ll.fish2
-rw-r--r--init/completions/ulimit.fish13
-rw-r--r--init/fish_function.fish19
7 files changed, 61 insertions, 7 deletions
diff --git a/doc_src/function.txt b/doc_src/function.txt
index 085072ef..6e55e0d9 100644
--- a/doc_src/function.txt
+++ b/doc_src/function.txt
@@ -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
diff --git a/doc_src/psub.txt b/doc_src/psub.txt
new file mode 100644
index 00000000..d69c16fb
--- /dev/null
+++ b/doc_src/psub.txt
@@ -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.
diff --git a/init/completions/function.fish b/init/completions/function.fish
index c8baba31..7fcaa2ab 100644
--- a/init/completions/function.fish
+++ b/init/completions/function.fish
@@ -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
diff --git a/init/completions/la.fish b/init/completions/la.fish
new file mode 100644
index 00000000..3868e53e
--- /dev/null
+++ b/init/completions/la.fish
@@ -0,0 +1,2 @@
+
+complete -y ls
diff --git a/init/completions/ll.fish b/init/completions/ll.fish
new file mode 100644
index 00000000..3868e53e
--- /dev/null
+++ b/init/completions/ll.fish
@@ -0,0 +1,2 @@
+
+complete -y ls
diff --git a/init/completions/ulimit.fish b/init/completions/ulimit.fish
new file mode 100644
index 00000000..2b040566
--- /dev/null
+++ b/init/completions/ulimit.fish
@@ -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"
diff --git a/init/fish_function.fish b/init/fish_function.fish
index afa48a67..55e8bf8d 100644
--- a/init/fish_function.fish
+++ b/init/fish_function.fish
@@ -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