mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 01:51:14 -03:00
Merge branch 'master' into documentation-update
Conflicts: doc_src/history.txt doc_src/test.txt
This commit is contained in:
@@ -232,8 +232,8 @@ b protect
|
||||
G
|
||||
#.
|
||||
# Uncomment the folowing two lines (ss) to log the buffer join.
|
||||
s/^.*$/JOIN: &/w debug-lexicon.log
|
||||
s/^JOIN: //
|
||||
# s/^.*$/JOIN: &/w debug-lexicon.log
|
||||
# s/^JOIN: //
|
||||
#.
|
||||
# Iterate over alternate lines, matching '<' to '\'
|
||||
:join
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
\subsection history-synopsis Synopsis
|
||||
\fish{syn}
|
||||
history [--save|--clear]
|
||||
history [--save|--clear|--merge]
|
||||
history [--search|--delete] [--prefix "prefix string"|--contains "search string"]
|
||||
\endfish
|
||||
|
||||
@@ -11,27 +11,17 @@ history [--search|--delete] [--prefix "prefix string"|--contains "search string"
|
||||
`history` is used to list, search and delete the history of commands used.
|
||||
|
||||
The following options are available:
|
||||
|
||||
- `--save` saves all changes in the history file. The shell automatically
|
||||
saves the history file; this option is provided for internal use.
|
||||
- `--clear` clears the history file. A prompt is displayed before the history
|
||||
is erased.
|
||||
- `--search` returns history items in keeping with the `--prefix` or
|
||||
`--contains` options.
|
||||
- `--save` saves all changes in the history file. The shell automatically saves the history file; this option is provided for internal use.
|
||||
- `--clear` clears the history file. A prompt is displayed before the history is erased.
|
||||
- `--merge` immediately incorporates history changes from other sessions. Ordinarily fish ignores history changes from sessions started after the current one. This command applies those changes immediately.
|
||||
- `--search` returns history items in keeping with the `--prefix` or `--contains` options.
|
||||
- `--delete` deletes history items.
|
||||
- `--prefix` searches or deletes items in the history that begin with the
|
||||
specified text string.
|
||||
- `--contains` searches or deletes items in the history that contain the
|
||||
specified text string.
|
||||
- `--prefix` searches or deletes items in the history that begin with the specified text string.
|
||||
- `--contains` searches or deletes items in the history that contain the specified text string.
|
||||
|
||||
If `--search` is specified without `--contains` or `--prefix`,
|
||||
`--contains` will be assumed.
|
||||
If `--search` is specified without `--contains` or `--prefix`, `--contains` will be assumed.
|
||||
|
||||
If `--delete` is specified without `--contains` or `--prefix`,
|
||||
only a history item which exactly matches the parameter will be erased. No
|
||||
prompt will be given. If `--delete` is specified with either of these
|
||||
parameters, an interactive prompt will be displayed before any items are
|
||||
deleted.
|
||||
If `--delete` is specified without `--contains` or `--prefix`, only a history item which exactly matches the parameter will be erased. No prompt will be given. If `--delete` is specified with either of these parameters, an interactive prompt will be displayed before any items are deleted.
|
||||
|
||||
\subsection history-examples Example
|
||||
|
||||
|
||||
@@ -7,9 +7,7 @@ test [EXPRESSION]
|
||||
|
||||
\subsection test-description Description
|
||||
|
||||
Tests the expression given and sets the exit status to 0 if true,
|
||||
and 1 if false. An expression is made up of one or more operators
|
||||
and their arguments.
|
||||
Tests the expression given and sets the exit status to 0 if true, and 1 if false. An expression is made up of one or more operators and their arguments.
|
||||
|
||||
The following operators are available to examine files and directories:
|
||||
- `-b FILE` returns true if `FILE` is a block device.
|
||||
@@ -18,11 +16,9 @@ The following operators are available to examine files and directories:
|
||||
- `-e FILE` returns true if `FILE` exists.
|
||||
- `-f FILE` returns true if `FILE` is a regular file.
|
||||
- `-g FILE` returns true if `FILE` has the set-group-ID bit set.
|
||||
- `-G FILE` returns true if `FILE` exists and has the same group ID
|
||||
as the current user.
|
||||
- `-G FILE` returns true if `FILE` exists and has the same group ID as the current user.
|
||||
- `-L FILE` returns true if `FILE` is a symbolic link.
|
||||
- `-O FILE` returns true if `FILE` exists and is owned by the current
|
||||
user.
|
||||
- `-O FILE` returns true if `FILE` exists and is owned by the current user.
|
||||
- `-p FILE` returns true if `FILE` is a named pipe.
|
||||
- `-r FILE` returns true if `FILE` is marked as readable.
|
||||
- `-s FILE` returns true if the size of `FILE` is greater than zero.
|
||||
@@ -33,10 +29,8 @@ user.
|
||||
- `-x FILE` returns true if `FILE` is marked as executable.
|
||||
|
||||
The following operators are available to compare and examine text strings:
|
||||
- `STRING1 = STRING2` returns true if the strings `STRING1` and
|
||||
`STRING2` are identical.
|
||||
- `STRING1 != STRING2` returns true if the strings `STRING1` and
|
||||
`STRING2` are not identical.
|
||||
- `STRING1 = STRING2` returns true if the strings `STRING1` and `STRING2` are identical.
|
||||
- `STRING1 != STRING2` returns true if the strings `STRING1` and `STRING2` are not identical.
|
||||
- `-n STRING` returns true if the length of `STRING` is non-zero.
|
||||
- `-z STRING` returns true if the length of `STRING` is zero.
|
||||
|
||||
@@ -48,22 +42,18 @@ The following operators are available to compare and examine numbers:
|
||||
- `NUM1 -lt NUM2` returns true if `NUM1` is less than `NUM2`.
|
||||
- `NUM1 -le NUM2` returns true if `NUM1` is less than or equal to `NUM2`.
|
||||
|
||||
Note that only integers are supported. For more complex mathematical
|
||||
operations, including fractions, the `env` program may be useful. Consult the
|
||||
documentation for your operating system.
|
||||
Note that only integers are supported. For more complex mathematical operations, including fractions, the `env` program may be useful. Consult the documentation for your operating system.
|
||||
|
||||
Expressions can be combined using the following operators:
|
||||
- `COND1 -a COND2` returns true if both `COND1` and `COND2` are true.
|
||||
- `COND1 -o COND2` returns true if either `COND1` or `COND2` are true.
|
||||
|
||||
Expressions can be inverted using the `!` operator:
|
||||
- `! EXPRESSION` returns true if `EXPRESSION` is false, and false if
|
||||
`EXPRESSION` is true.
|
||||
- `! EXPRESSION` returns true if `EXPRESSION` is false, and false if `EXPRESSION` is true.
|
||||
|
||||
Expressions can be grouped using parentheses.
|
||||
- `( EXPRESSION )` returns the value of `EXPRESSION`.
|
||||
Note that parentheses will usually require escaping with `\\(` to avoid
|
||||
being interpreted as a command substitution.
|
||||
Note that parentheses will usually require escaping with `\\(` to avoid being interpreted as a command substitution.
|
||||
|
||||
\subsection test-example Examples
|
||||
|
||||
@@ -75,17 +65,15 @@ if test -d /tmp
|
||||
end
|
||||
\endfish
|
||||
|
||||
If the variable `MANPATH` is defined and not empty, print the contents:
|
||||
If the variable `MANPATH` is defined and not empty, print the contents. (If `MANPATH` is not defined, then it will expand to zero arguments, unless quoted.)
|
||||
|
||||
\fish
|
||||
if test -n $MANPATH
|
||||
if test -n "$MANPATH"
|
||||
echo $MANPATH
|
||||
end
|
||||
\endfish
|
||||
|
||||
Parentheses and the `-o` and `-a` operators can be combined to produce
|
||||
more complicated expressions. In this example, success is printed if there is
|
||||
a `/foo` or `/bar` file as well as a `/baz` or `/bat` file.
|
||||
Parentheses and the `-o` and `-a` operators can be combined to produce more complicated expressions. In this example, success is printed if there is a `/foo` or `/bar` file as well as a `/baz` or `/bat` file.
|
||||
|
||||
\fish
|
||||
if test \( -f /foo -o -f /bar \) -a \( -f /baz -o -f /bat \)
|
||||
@@ -96,14 +84,7 @@ end.
|
||||
\subsection test-standards Standards
|
||||
|
||||
`test` implements a subset of the
|
||||
<a href="http://www.unix.com/man-page/POSIX/1/test/">IEEE Std 1003.1-2008
|
||||
(POSIX.1) standard</a>. The following exceptions apply:
|
||||
<a href="http://www.unix.com/man-page/POSIX/1/test/">IEEE Std 1003.1-2008 (POSIX.1) standard</a>. The following exceptions apply:
|
||||
- The `<` and `>` operators for comparing strings are not implemented.
|
||||
- Because this test is a shell builtin and not a standalone utility, using
|
||||
the -c flag on a special file descriptors like standard input and output
|
||||
may not return the same result when invoked from within a pipe as one
|
||||
would expect when invoking the `test` utility in another shell.
|
||||
|
||||
In cases such as this, one can use `command` `test` to explicitly
|
||||
use the system's standalone `test` rather than this `builtin` `test`.
|
||||
|
||||
- Because this test is a shell builtin and not a standalone utility, using the -c flag on a special file descriptors like standard input and output may not return the same result when invoked from within a pipe as one would expect when invoking the `test` utility in another shell.
|
||||
In cases such as this, one can use `command` `test` to explicitly use the system's standalone `test` rather than this `builtin` `test`.
|
||||
|
||||
@@ -131,7 +131,8 @@ h3 {
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #AAA;
|
||||
}
|
||||
/*Special Formmating for Code and keys*/
|
||||
/* Special Formmating */
|
||||
/* Keyboard */
|
||||
.key span {
|
||||
display:none;
|
||||
}
|
||||
@@ -147,14 +148,12 @@ h3 {
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
}
|
||||
/* Console display */
|
||||
tt, code, pre, .fish {
|
||||
font-family: "DejaVu Sans Mono", Menlo, Monaco, "Source Code Pro", "Ubuntu Mono", "Consolas", "Lucida Console", monospace, fixed;
|
||||
font-weight: 500;
|
||||
text-shadow: 0 0 0 rgba(0,0,0,1); /* Stronger anti-aliasing */
|
||||
}
|
||||
tt {
|
||||
color: red; /*REMOVE THIS*/
|
||||
}
|
||||
code, pre, .line {
|
||||
white-space: -moz-pre-wrap;
|
||||
white-space: -pre-wrap;
|
||||
@@ -166,50 +165,51 @@ h1 > code, h2 > code, h3 > code {
|
||||
font-family: "DejaVu Sans Mono", Menlo, "Source Code Pro", "Consolas", "Lucida Console", Roboto, Verdana, sans-serif;
|
||||
font-weight: 700;
|
||||
}
|
||||
/*Default 'light' console*/
|
||||
.fish {
|
||||
margin: 1rem;
|
||||
padding: 0.4rem 1rem;
|
||||
line-height: 1.9rem;
|
||||
color: #222;
|
||||
background-color: #fafafa;
|
||||
border: 1px solid #f0f0f0;
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
|
||||
.comment { color: #777; }
|
||||
.command { color: #0A0; }
|
||||
.function { color: #0A0; }
|
||||
.binary { color: #060; }
|
||||
.argument { color: #906; }
|
||||
.variable { color: #339; }
|
||||
.redirect { color: #F00; }
|
||||
.operator { color: #990; }
|
||||
.file { color: #c97922; }
|
||||
.path { color: #c97922; }
|
||||
.string { color: #770; }
|
||||
.prompt { color: #03C; }
|
||||
.suggest { color: cyan ; }
|
||||
.error { color: red; font-weight: bold; }
|
||||
.cursor { border-bottom: 2px solid green; }
|
||||
|
||||
|
||||
/*.keyword, .keywordflow { color: #050; }*/
|
||||
/*.stringliteral, .charliteral { color: #226; }*/
|
||||
/*.preprocessor, .comment { color: #555; text-shadow: none; }*/
|
||||
|
||||
.cli-dark {
|
||||
background-color: #111;
|
||||
color: #ddd;
|
||||
padding: 0.4rem 2rem;
|
||||
padding: 0.4rem 1rem;
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
/*
|
||||
.cli .command {
|
||||
color: #0E0;
|
||||
font-weight: bold;
|
||||
.normal { @normal@; }
|
||||
.comment { @comment@; }
|
||||
.command { @command@; }
|
||||
.function { @command@; }
|
||||
.binary { @command@; }
|
||||
.argument { @param@ }
|
||||
.variable { @param@ }
|
||||
.redirect { @redirection@ }
|
||||
.operator { @operator@ }
|
||||
.file { @valid_path@ }
|
||||
.path { @valid_path@ }
|
||||
.string { @quote@ }
|
||||
.suggest { @autosuggestion@ }
|
||||
.error { @error@ }
|
||||
.match { @match@ }
|
||||
.search_match { @search_match@ }
|
||||
.user { @user@ }
|
||||
.cwd { @cwd@ }
|
||||
.history { @history_current@ }
|
||||
.prompt { color: #222; }
|
||||
.cursor { border-bottom: 2px solid green; }
|
||||
.underline { text-decoration: underline; }
|
||||
/* Console variants */
|
||||
.cli-dark {
|
||||
background-color: #111;
|
||||
color: #ddd;
|
||||
padding: 0.4rem 1rem;
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
.cli .function {
|
||||
color: #0C0;
|
||||
}*/
|
||||
/*Menus*/
|
||||
.menu { margin: 1.4rem 0; line-height: 2.2rem; }
|
||||
.menu ul { list-style-type: none; }
|
||||
|
||||
Reference in New Issue
Block a user