>lexicon.tmp -n \
-e "s|^.*>\([a-z][a-z_]*\)|'\1'|w lexicon_catalog.tmp" \
- -e "s|'\(.*\)'|cmnd \1|p"; mv lexicon_catalog.tmp lexicon_catalog.txt; \
+ -e "s|'\(.*\)'|bltn \1|p"; mv lexicon_catalog.tmp lexicon_catalog.txt; \
printf "%s\n" $(COMPLETIONS_DIR_FILES) | sed -n \
-e "s|[^ ]*/\([a-z][a-z_-]*\).fish|'\1'|p" | fgrep -vx -f lexicon_catalog.txt | sed >>lexicon.tmp -n \
-e 'w lexicon_catalog.tmp' \
- -e "s|'\(.*\)'|sbin \1|p"; cat lexicon_catalog.tmp >> lexicon_catalog.txt; \
+ -e "s|'\(.*\)'|cmnd \1|p"; cat lexicon_catalog.tmp >> lexicon_catalog.txt; \
printf "%s\n" $(FUNCTIONS_DIR_FILES) | sed -n \
-e "s|[^ ]*/\([a-z][a-z_-]*\).fish|'\1'|p" | fgrep -vx -f lexicon_catalog.txt | sed >>lexicon.tmp -n \
-e 'w lexicon_catalog.tmp' \
diff --git a/doc_src/FORMATTING.md b/doc_src/FORMATTING.md
index b5bef345f..74b530a49 100644
--- a/doc_src/FORMATTING.md
+++ b/doc_src/FORMATTING.md
@@ -102,4 +102,8 @@ Some useful Unicode/HTML5 entities:
### Lists
+### Synopsis rules
+
+### Prompts and cursor
+
#### Author: Mark Griffiths [@GitHub](https://github.com/MarkGriffiths)
\ No newline at end of file
diff --git a/doc_src/commands.hdr.in b/doc_src/commands.hdr.in
index fb9ebefa2..0ffb9d52f 100644
--- a/doc_src/commands.hdr.in
+++ b/doc_src/commands.hdr.in
@@ -14,6 +14,21 @@
\endhtmlonly
`fish` ships with a large number of builtin commands, shellscript functions and external commands. These are all described below.
+Almost all fish commands respond to the `-h` or `--help` options to display their relevant help, also accessible using the `help` and `man` commands, like so:
+
+\fish
+echo -h
+echo --help
+# Prints help to the terminal window
+
+man echo
+# Displays the man page in the system pager
+# (normally 'less', 'more' or 'most').
+
+help echo
+# Open a web browser to show the relevant documentation
+\endfish
+
@command_list@
\htmlonly[block]
diff --git a/doc_src/contains.txt b/doc_src/contains.txt
index 4c947c9df..f3966d82c 100644
--- a/doc_src/contains.txt
+++ b/doc_src/contains.txt
@@ -12,7 +12,6 @@ contains [OPTIONS] KEY [VALUES...]
The following options are available:
- `-i` or `--index` print the word index
-- `-h` or `--help` display this message
\subsection contains-example Example
diff --git a/doc_src/count.txt b/doc_src/count.txt
index 9f904311f..279ead7d5 100644
--- a/doc_src/count.txt
+++ b/doc_src/count.txt
@@ -9,7 +9,7 @@ count $VARIABLE
`count` prints the number of arguments that were passed to it. This is usually used to find out how many elements an environment variable array contains.
-`count` does not accept any options, including '`-h`'.
+`count` does not accept any options, including `-h` or `--help`.
`count` exits with a non-zero exit status if no arguments were passed to it, and with zero if at least one argument was passed.
diff --git a/doc_src/echo.txt b/doc_src/echo.txt
index d70627161..c53d30098 100644
--- a/doc_src/echo.txt
+++ b/doc_src/echo.txt
@@ -19,8 +19,6 @@ The following options are available:
- `-e`, Enable interpretation of backslash escapes
-- `-h`, `--help` Display this help
-
\subsection echo-escapes Escape Sequences
If `-e` is used, the following sequences are recognized:
diff --git a/doc_src/fish.txt b/doc_src/fish.txt
index 05f48d66d..bf9c3eb1b 100644
--- a/doc_src/fish.txt
+++ b/doc_src/fish.txt
@@ -15,8 +15,6 @@ The following options are available:
- `-d` or `--debug-level=DEBUG_LEVEL` specify the verbosity level of fish. A higher number means higher verbosity. The default level is 1.
-- `-h` or `--help` display help and exit
-
- `-i` or `--interactive` specify that fish is to run in interactive mode
- `-l` or `--login` specify that fish is to run as a login shell
diff --git a/doc_src/fish_indent.txt b/doc_src/fish_indent.txt
index 386835dc9..1d4694e3a 100644
--- a/doc_src/fish_indent.txt
+++ b/doc_src/fish_indent.txt
@@ -11,8 +11,6 @@ fish_indent [OPTIONS]
The following options are available:
-- `-h` or `--help` displays this help message and then exits
-
- `-i` or `--no-indent` do not indent commands
- `-v` or `--version` displays the current fish version and then exits
diff --git a/doc_src/functions.txt b/doc_src/functions.txt
index 0750cd1b8..1a5b1c078 100644
--- a/doc_src/functions.txt
+++ b/doc_src/functions.txt
@@ -22,8 +22,6 @@ The following options are available:
- `-e` or `--erase` causes the specified functions to be erased.
-- `-h` or `--help` displays a help message and exits.
-
- `-n` or `--names` lists the names of all defined functions.
- `-q` or `--query` tests if the specified functions exist.
@@ -42,9 +40,13 @@ The exit status of `functions` is the number of functions specified in the argum
\subsection functions-example Examples
+\fish
+functions -n
+# Displays a list of currently-defined functions
-`functions -n` displays a list of currently-defined functions.
+functions -c foo bar
+# Copies the 'foo' function to a new function called 'bar'
-`functions -c foo bar` copies the `foo` function to a new function called `bar`.
-
-`functions -e bar` erases the function `bar`.
+functions -e bar
+# Erases the function `bar`
+\endfish
diff --git a/doc_src/index.hdr.in b/doc_src/index.hdr.in
index 8d827cd65..4c99944ae 100644
--- a/doc_src/index.hdr.in
+++ b/doc_src/index.hdr.in
@@ -1029,8 +1029,11 @@ When the cursor is over a parenthesis or a quote, `fish` also highlights its mat
To customize the syntax highlighting, you can set the environment variables `fish_color_normal`, `fish_color_command`, `fish_color_substitution`, `fish_color_redirection`, `fish_color_end`, `fish_color_error`, `fish_color_param`, `fish_color_comment`, `fish_color_match`, `fish_color_search_match`, `fish_color_cwd`, `fish_pager_color_prefix`, `fish_pager_color_completion`, `fish_pager_color_description`, `fish_pager_color_progress` and `fish_pager_color_secondary`. Usually, the value of these variables will be one of `black`, `red`, `green`, `brown`, `yellow`, `blue`, `magenta`, `purple`, `cyan`, `white` or `normal`, but they can be an array containing any color options for the `set_color` command.
-Issuing `set fish_color_error black --background=red --bold` will make all commandline errors be written in a black, bold font, with a red background.
-
+\fish
+set fish_color_error black --background=red --bold
+# Make all commandline errors be written in a black,
+# bold font, with a red background.
+\endfish
\subsection title Programmable title
diff --git a/doc_src/jobs.txt b/doc_src/jobs.txt
index fbdc05793..613266d32 100644
--- a/doc_src/jobs.txt
+++ b/doc_src/jobs.txt
@@ -15,8 +15,6 @@ jobs accepts the following switches:
- `-g` or `--group` only prints the group ID of each job.
-- `-h` or `--help` displays a help message and exits.
-
- `-l` or `--last` prints only the last job to be started.
- `-p` or `--pid` prints the process ID for each process in all jobs.
diff --git a/doc_src/mimedb.txt b/doc_src/mimedb.txt
index b7ec29cee..197474440 100644
--- a/doc_src/mimedb.txt
+++ b/doc_src/mimedb.txt
@@ -25,6 +25,4 @@ The following options are available:
- `-l`, `--launch` launches the default action for the specified files.
-- `-h`, `--help` displays a help message and exit.
-
- `-v`, `--version` displays the version number and exits.
diff --git a/doc_src/set_color.txt b/doc_src/set_color.txt
index ab4916dfd..f48926a85 100644
--- a/doc_src/set_color.txt
+++ b/doc_src/set_color.txt
@@ -17,8 +17,6 @@ The following options are available:
- `-c`, `--print-colors` prints a list of all valid color names.
-- `-h`, `--help` displays a help message and exit.
-
- `-o`, `--bold` sets bold or extra bright mode.
- `-u`, `--underline` sets underlined mode.
@@ -38,6 +36,6 @@ Not all terminal emulators support all these features.
\fish
set_color red; echo "Roses are red"
set_color blue; echo "Violets are blue"
-set_color 62A ; echo "Eggplants are dark purple"
+set_color 62A; echo "Eggplants are dark purple"
set_color normal; echo "Normal is nice too"
\endfish
diff --git a/doc_src/status.txt b/doc_src/status.txt
index c6b463945..b939f6fe9 100644
--- a/doc_src/status.txt
+++ b/doc_src/status.txt
@@ -32,5 +32,3 @@ The following options are available:
- `-j CONTROLTYPE` or `--job-control=CONTROLTYPE` sets the job control type, which can be `none`, `full`, or `interactive`.
- `-t` or `--print-stack-trace` prints a stack trace of all function calls on the call stack.
-
-- `-h` or `--help` displays a help message and exit.
diff --git a/doc_src/trap.txt b/doc_src/trap.txt
index 3537e760b..d4380550c 100644
--- a/doc_src/trap.txt
+++ b/doc_src/trap.txt
@@ -15,8 +15,6 @@ The following parameters are available:
- `SIGSPEC` is the name of the signal to trap.
-- `-h` or `--help` displays help and exits.
-
- `-l` or `--list-signals` prints a list of signal names.
- `-p` or `--print` prints all defined signal handlers.
diff --git a/doc_src/tutorial.hdr b/doc_src/tutorial.hdr
index aa67cf606..a63808e19 100644
--- a/doc_src/tutorial.hdr
+++ b/doc_src/tutorial.hdr
@@ -581,7 +581,7 @@ vim
\section tut-more Ready for more?
-If you want to learn more about fish, there is lots of detailed documentation, an official mailing list, the IRC channel \#fish on `irc.oftc.net`, and the github page.
+If you want to learn more about fish, there is lots of detailed documentation, an official mailing list, the IRC channel \#fish on `irc.oftc.net`, and the github page.
\htmlonly[block]
diff --git a/doc_src/ulimit.txt b/doc_src/ulimit.txt
index c6c40a078..86ffe2b6f 100644
--- a/doc_src/ulimit.txt
+++ b/doc_src/ulimit.txt
@@ -49,8 +49,6 @@ The following additional options are also understood by `ulimit`:
- `-a` or `--all` prints all current limits
-- `-h` or `--help` displays help and exits.
-
The `fish` implementation of `ulimit` should behave identically to the implementation in bash, except for these differences:
- Fish `ulimit` supports GNU-style long options for all switches
diff --git a/lexicon_filter.in b/lexicon_filter.in
index 33d4bef59..1b813fbbd 100644
--- a/lexicon_filter.in
+++ b/lexicon_filter.in
@@ -16,7 +16,7 @@
# ALIASES += "endfish=\endhtmlonly \n"
#.
# ALIASES += "blah{1}="
-# ALIASES += "cmnd{1}=\1" and so on...
+# ALIASES += "bltn{1}=\1" and so on...
#.
# And simplify for man pages (Doxyfile.help)…
# ALIASES = "fish="
@@ -24,7 +24,7 @@
# ALIASES += "endfish=
"
#.
# ALIASES += "blah{1}=\1"
-# ALIASES += "cmnd{1}=\1"...
+# ALIASES += "bltn{1}=\1"...
#.
# It's meant to only ever be run once, during make, as Doxygen's 'INPUT
# FILTER', though can be run interactively by passing a file in via stdin. It
@@ -301,17 +301,17 @@ s/^PreClean: //
}
/@vars/{
:cleanvars
- s/\(vars{@optr{$}[^@}]*\)@cmnd{\([^}]*\)}/\1\2/
+ s/\(vars{@optr{$}[^@}]*\)@bltn{\([^}]*\)}/\1\2/
s/\(vars{@optr{$}[^@}]*\)@func{\([^}]*\)}/\1\2/
- s/\(vars{@optr{$}[^@}]*\)@sbin{\([^}]*\)}/\1\2/
+ s/\(vars{@optr{$}[^@}]*\)@cmnd{\([^}]*\)}/\1\2/
s/\(vars{@optr{$}[^@}]*\)@args{\([^}]*\)}/\1\2/
t cleanvars
}
/@redr/{
:cleanredr
- s/\(redr{[^@}]*\)@cmnd{\([^}]*\)}/\1\2/
+ s/\(redr{[^@}]*\)@bltn{\([^}]*\)}/\1\2/
s/\(redr{[^@}]*\)@func{\([^}]*\)}/\1\2/
- s/\(redr{[^@}]*\)@sbin{\([^}]*\)}/\1\2/
+ s/\(redr{[^@}]*\)@cmnd{\([^}]*\)}/\1\2/
s/\(redr{[^@}]*\)@fsfo{\([^}]*\)}/\1\2/
s/\(redr{[^}]*\)}\( *\)@path{\([^}]*\)/\1\2\3/
t cleanredr
@@ -319,9 +319,9 @@ s/^PreClean: //
/@sgst/{
s/@sgst{<@/@sgst{@/
:cleansgst
- s/\(sgst{@curs{.}[^@]*\)@cmnd{\([^}]*\)}/\1\2/
+ s/\(sgst{@curs{.}[^@]*\)@bltn{\([^}]*\)}/\1\2/
s/\(sgst{@curs{.}[^@]*\)@func{\([^}]*\)}/\1\2/
- s/\(sgst{@curs{.}[^@]*\)@sbin{\([^}]*\)}/\1\2/
+ s/\(sgst{@curs{.}[^@]*\)@cmnd{\([^}]*\)}/\1\2/
s/\(sgst{@curs{.}[^@]*\)@opts{\([^}]*\)}/\1\2/
s/\(sgst{@curs{.}[^@]*\)@path{\([^}]*\)}/\1\2/
s/\(sgst{@curs{.}[^@]*\)@args{\([^}]*\)}/\1\2/
@@ -330,9 +330,9 @@ s/^PreClean: //
}
/@fsfo/{
:cleanfsfo
- s/\(fsfo{[^@}]*\)@cmnd{\([^}]*\)}/\1\2/
+ s/\(fsfo{[^@}]*\)@bltn{\([^}]*\)}/\1\2/
s/\(fsfo{[^@}]*\)@func{\([^}]*\)}/\1\2/
- s/\(fsfo{[^@}]*\)@sbin{\([^}]*\)}/\1\2/
+ s/\(fsfo{[^@}]*\)@cmnd{\([^}]*\)}/\1\2/
t cleanfsfo
}
/@prmt{/{
@@ -372,92 +372,94 @@ x
s/^@prmt *//
}
#.
+# Special case for optional commands
+s/@args{\[@bltn/@args{[@xbln/g
# Special case for one-line 'if' statements
-/@cmnd{if}/ {
- s//@xcmd{if}/
- s/@cmnd{set}/@xcmd{set}/
- s/@cmnd{not}/@xcmd{not}/
- s/@cmnd{else}/@xcmd{else}/
- s/@cmnd{contains}/@xcmd{contains}/
- s/@cmnd{test}/@xcmd{test}/
- s/@cmnd{end}/@xcmd{end}/
- s/@sbin{grep}/@xbin{grep}/
+/@bltn{if}/ {
+ s//@xbln{if}/
+ s/@bltn{set}/@xbln{set}/
+ s/@bltn{not}/@xbln{not}/
+ s/@bltn{else}/@xbln{else}/
+ s/@bltn{contains}/@xbln{contains}/
+ s/@bltn{test}/@xbln{test}/
+ s/@bltn{end}/@xbln{end}/
+ s/@cmnd{grep}/@xcmd{grep}/
}
# one-line 'for' statements
-/@cmnd{for}/ {
- s//@xcmd{for}/
- s/@args{in}/@xcmd{in}/
+/@bltn{for}/ {
+ s//@xbln{for}/
+ s/@args{in}/@xbln{in}/
}
# one-line 'begin' statements
-/@cmnd{begin}/ {
- s//@xcmd{begin}/
- s/@cmnd{end}/@xcmd{end}/
+/@bltn{begin}/ {
+ s//@xbln{begin}/
+ s/@bltn{end}/@xbln{end}/
}
# one-line 'break' statements
-/@cmnd{break}/ {
- s//@xcmd{break}/
- s/@cmnd{end}/@xcmd{end}/
+/@bltn{break}/ {
+ s//@xbln{break}/
+ s/@bltn{end}/@xbln{end}/
}
# one-line 'continue' statements
-/@cmnd{continue}/ {
- s//@xcmd{continue}/
- s/@cmnd{end}/@xcmd{end}/
+/@bltn{continue}/ {
+ s//@xbln{continue}/
+ s/@bltn{end}/@xbln{end}/
}
# one-line 'switch' statements
-/@cmnd{switch}/ {
- s//@xcmd{switch}/
- s/@cmnd{case}/@xcmd{case}/
- s/@cmnd{end}/@xcmd{end}/
+/@bltn{switch}/ {
+ s//@xbln{switch}/
+ s/@bltn{case}/@xbln{case}/
+ s/@bltn{end}/@xbln{end}/
}
# one-line 'function' statements
-/@cmnd{function}/ {
- s//@xcmd{function}/
- s/@cmnd{return}/@xcmd{return}/
- s/@cmnd{end}/@xcmd{end}/
+/@bltn{function}/ {
+ s//@xbln{function}/
+ s/@bltn{return}/@xbln{return}/
+ s/@bltn{end}/@xbln{end}/
}
# one-line 'bind' statements - special input functions
-/@cmnd{bind}/ {
- s//@xcmd{bind}/
+/@bltn{bind}/ {
+ s//@xbln{bind}/
s/@....{\([a-z]*\)}\(-[a-z-]*\)/@args{\1\2}/
}
# one-line 'builtin' statements
-s/@cmnd{builtin} @cmnd/@xcmd{builtin} @xcmd/g
-s/@cmnd{builtin} @sbin/@xcmd{builtin} @xbin/g
-s/@cmnd{builtin} @func/@xcmd{builtin} @xfnc/g
+s/@bltn{builtin} @bltn/@xbln{builtin} @xbln/g
+s/@bltn{builtin} @cmnd/@xbln{builtin} @xcmd/g
+s/@bltn{builtin} @func/@xbln{builtin} @xfnc/g
#.
# one-line 'command' statements
-s/@cmnd{command} @cmnd/@xcmd{command} @xcmd/g
-s/@cmnd{command} @sbin/@xcmd{command} @xbin/g
-s/@cmnd{command} @func/@xcmd{command} @xfnc/g
+s/@bltn{command} @bltn/@xbln{command} @xbln/g
+s/@bltn{command} @cmnd/@xbln{command} @xcmd/g
+s/@bltn{command} @func/@xbln{command} @xfnc/g
#.
# one-line 'and/or' statements
-s/@cmnd{and} @cmnd/@xcmd{and} @xcmd/g
-s/@cmnd{and} @sbin/@xcmd{and} @xbin/g
-s/@cmnd{and} @func/@xcmd{and} @xfnc/g
-s/@cmnd{or} @cmnd/@xcmd{or} @xcmd/g
-s/@cmnd{or} @sbin/@xcmd{or} @xbin/g
-s/@cmnd{or} @func/@xcmd{or} @xfnc/g
+s/@bltn{and} @bltn/@xbln{and} @xbln/g
+s/@bltn{and} @cmnd/@xbln{and} @xcmd/g
+s/@bltn{and} @func/@xbln{and} @xfnc/g
+s/@bltn{or} @bltn/@xbln{or} @xbln/g
+s/@bltn{or} @cmnd/@xbln{or} @xcmd/g
+s/@bltn{or} @func/@xbln{or} @xfnc/g
#.
-s/^\( *\)@sbin/\1@xbin/
-s/\( *[;()] *\)@sbin/\1@xbin/g
-s/\( *@redr{|} *\)@sbin/\1@xbin/g
s/^\( *\)@cmnd/\1@xcmd/
s/\( *[;()] *\)@cmnd/\1@xcmd/g
s/\( *@redr{|} *\)@cmnd/\1@xcmd/g
+s/^\( *\)@bltn/\1@xbln/
+s/\( *[;()] *\)@bltn/\1@xbln/g
+s/\( *@redr{|} *\)@bltn/\1@xbln/g
s/^\( *\)@func/\1@xfnc/
s/\( *[;()] *\)@func/\1@xfnc/g
s/\( *@redr{|} *\)@func/\1@xfnc/g
-s/\\@cmnd{\([^}]*\)/@args{@bksl{\1}/g
-s/@cmnd/@args/g
+s/\\@bltn{\([^}]*\)/@args{@bksl{\1}/g
+s/@bltn/@args/g
s/@func/@args/g
-s/@sbin/@args/g
+s/@cmnd/@args/g
#.
s/^.*$/PostArgs: &/w lexicon.log
s/^PostArgs: //
#.
-s/xcmd/cmnd/g
+s/xbln/bltn/g
s/xfnc/func/g
-s/xbin/sbin/g
+s/xcmd/cmnd/g
x
/^@prmt/ {
G
@@ -473,9 +475,23 @@ x
s/\</g
s/>/\>/g
s/((d))/@/g
+#.
+# Final post processing
+s/};\([^]]\)/}@redr{;}\1/g
+s/};$/}@redr{;}/
+s/ \[\([@(]\)/ @args{[}\1/g
+s/ \[\([A-Z]*\) / @args{[\1} /g
+s/@args{\([a-zA-Z0-9_.]*\)}\]/@args{\1]}/g
+s/@args{\([a-zA-Z0-9_.]*\)}: /@args{\1:} /g
+s/@bltn{echo} @fsfo/@bltn{echo} @args/g
+s/@bltn{echo}\([a-zA-Z0-9.@{} _-]*\)@fsfo/@bltn{echo}\1@args/g
+s/ \] / @args{]} /g
+s/ \]$/ @args{]}/g
+s/\]}\]$/]]}/
s/\\\([()]\)/@optr{@bksl{\1}}/g
s/\([()]\)/@optr{\1}/g
s/\\n/@bksl{n}/
+s/ \\$//
#.
# Uncomment the folowing two lines (ss) to log the final output, sent to Doxygen.
s/^.*$/Output : &\
@@ -562,25 +578,25 @@ s/\(@path{[^}]*\)}@fsfo/\1}@fsfo/
#.
#### This section is built in the Makefile. Just some formatting examples. #####
#.
-# fish commands (cmnd) <- 4 character code that has a Doxygen alias counterpart
-# template : s/[[:<:]]function[[:>:]]/@cmnd{&}/
+# Fish builtin (bltn) <- 4 character code that has a Doxygen alias counterpart
+# template : s/[[:<:]]function[[:>:]]/@bltn{&}/
#.
-# s,[[:<:]]function[[:>:]],@cmnd{function},g
-# s,[[:<:]]begin[[:>:]],@cmnd{begin},g
+# s,[[:<:]]function[[:>:]],@bltn{function},g
+# s,[[:<:]]begin[[:>:]],@bltn{begin},g
# ...
#.
-# fish functions (func)
+# Fish functions (func)
# Populated by 'public' functions' filename.
#.
# s,[[:<:]]fish_pwd[[:>:]],@func{fish_pwd},g
# s,[[:<:]]fish_prompt[[:>:]],@func{fish_prompt},g
# ...
#.
-# Shell Binary (sbin)
+# Shell Command (cmnd)
# Populated from completion filenames
#.
-# s,[[:<:]]seq[[:>:]],@sbin{seq},g
-# s,[[:<:]]rm[[:>:]],@sbin{rm},g
+# s,[[:<:]]seq[[:>:]],@cmnd{seq},g
+# s,[[:<:]]rm[[:>:]],@cmnd{rm},g
# ...
#.
# Color Variable (clrv)