fish-shell/sphinx_doc_src/cmds
Johannes Altmanninger 7d5b44e828 Support FOO=bar syntax for passing variables to individual commands
This adds initial support for statements with prefixed variable assignments.
Statments like this are supported:

a=1 b=$a echo $b        # outputs 1

Just like in other shells, the left-hand side of each assignment must
be a valid variable identifier (no quoting/escaping).  Array indexing
(PATH[1]=/bin ls $PATH) is *not* yet supported, but can be added fairly
easily.

The right hand side may be any valid string token, like a command
substitution, or a brace expansion.

Since `a=* foo` is equivalent to `begin set -lx a *; foo; end`,
the assignment, like `set`, uses nullglob behavior, e.g. below command
can safely be used to check if a directory is empty.

x=/nothing/{,.}* test (count $x) -eq 0

Generic file completion is done after the equal sign, so for example
pressing tab after something like `HOME=/` completes files in the
root directory
Subcommand completion works, so something like
`GIT_DIR=repo.git and command git ` correctly calls git completions
(but the git completion does not use the variable as of now).

The variable assignment is highlighted like an argument.

Closes #6048
2019-11-25 09:20:51 +01:00
..
abbr.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
alias.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
and.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
argparse.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
begin.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
bg.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
bind.rst Docs: escape word characters after backticks 2019-11-01 19:11:51 +01:00
block.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
break.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
breakpoint.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
builtin.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
case.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
cd.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
cdh.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
command.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
commandline.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
complete.rst complete: document change in 22ce8c23c6 2019-10-04 07:13:17 +08:00
contains.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
continue.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
count.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
dirh.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
dirs.rst doc: add links between dirs, pushd and popd 2019-10-16 09:05:59 +02:00
disown.rst doc: add links to bg, fg and jobs in disown command 2019-10-15 12:57:01 -07:00
echo.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
else.rst doc: add cross-refs between if and else commands 2019-10-10 18:17:10 +02:00
emit.rst doc: add link to event handlers in emit 2019-10-06 15:09:01 +02:00
end.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
eval.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
exec.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
exit.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
false.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fg.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish.rst Add support for fish_trace variable to trace execution 2019-11-02 14:40:57 -07:00
fish_breakpoint_prompt.rst doc: add ref to cmd-breakpoint 2019-10-02 15:53:22 +02:00
fish_config.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish_git_prompt.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish_hg_prompt.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish_indent.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish_key_reader.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish_mode_prompt.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish_opt.rst docs: Fix fish_opt options 2019-06-11 14:10:39 +02:00
fish_prompt.rst docs: Add labels to all commands 2019-03-31 11:05:33 +02:00
fish_right_prompt.rst docs: Add labels to all commands 2019-03-31 11:05:33 +02:00
fish_svn_prompt.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish_update_completions.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
fish_vcs_prompt.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
for.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
funced.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
funcsave.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
function.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
functions.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
help.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
history.rst history: Use --contains by default for "delete" 2019-11-01 08:53:24 +01:00
if.rst doc: add cross-refs between if and else commands 2019-10-10 18:17:10 +02:00
isatty.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
jobs.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
math.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
nextd.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
not.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
open.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
or.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
popd.rst doc: add links between dirs, pushd and popd 2019-10-16 09:05:59 +02:00
prevd.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
printf.rst doc: add link to echo in printf command 2019-10-24 21:44:53 +02:00
prompt_pwd.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
psub.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
pushd.rst doc: add links between dirs, pushd and popd 2019-10-16 09:05:59 +02:00
pwd.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
random.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
read.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
realpath.rst docs: improve realpath documentation 2019-09-17 20:48:22 +08:00
return.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
set.rst Support FOO=bar syntax for passing variables to individual commands 2019-11-25 09:20:51 +01:00
set_color.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
source.rst doc: document relative path support for source. 2019-10-14 18:58:30 +02:00
status.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
string-collect.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-escape.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-join.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-join0.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-length.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-lower.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-match.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-repeat.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-replace.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-split.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-split0.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-sub.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-trim.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-unescape.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string-upper.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
string.rst Add individual documentation pages for string's subcommands 2019-11-07 09:54:25 +01:00
suspend.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
switch.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
test.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
trap.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
true.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
type.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
ulimit.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
umask.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
vared.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00
wait.rst Docs: escape word characters after backticks 2019-11-01 19:11:51 +01:00
while.rst docs: update all command synopsis formatting 2019-09-17 17:59:04 +08:00