Commit Graph

208 Commits

Author SHA1 Message Date
David Adam
b8a9f2f228 docs: restore compatibility with Sphinx < 1.8.0 2019-11-26 18:17:20 +08:00
Osamu Aoki
435556001e "eval" example to use $cmd as an array
Signed-off-by: Osamu Aoki <osamu@debian.org>
2019-11-25 13:23:21 +01:00
Osamu Aoki
d7e545d89b "source" to identify itself as a "block" first
Signed-off-by: Osamu Aoki <osamu@debian.org>
2019-11-25 13:23:21 +01:00
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
Johannes Altmanninger
08eac28bd8 Add individual documentation pages for string's subcommands
This adds string-x.rst for each subcommand x of string. The main page
(string.rst) is not changed, except that examples are shown directly after
each subcommand.  The subcommand sections in string.rst are created by
textual inclusion of parts of the string-x.rst files.

Subcommand man pages can be viewed with either of:

```
man string collect
man string-collect
string collect <press F1 or Alt-h>
string collect -h
```

While `string -h ...` still prints the full help.

Closes #5968
2019-11-07 09:54:25 +01:00
Johannes Altmanninger
12e783e30e sphinx docs: put search box above TOC
Makes it visible without having to scroll down.
[ci skip]
2019-11-05 08:47:06 +01:00
Fabian Homborg
e68c24beff docs/tutorial: Fix formatting
This removes the explicit html coloring that was used in the tutorial.
Where necessary we just add pseudo-html like `<red>...</red>` to
explain it to the users.

I don't know how to reintroduce coloring here, but it's not super
important as the user can always just check for themselves.

See #5696

[ci skip]
2019-11-04 20:08:45 +01:00
ridiculousfish
a7f1d2c0c7 Add support for fish_trace variable to trace execution
This adds support for `fish_trace`, a new variable intended to serve the
same purpose as `set -x` as in bash. Setting this variable to anything
non-empty causes execution to be traced. In the future we may give more
specific meaning to the value of the variable.

The user's prompt is not traced unless you run it explicitly. Events are
also not traced because it is noisy; however autoloading is.

Fixes #3427
2019-11-02 14:40:57 -07:00
Johannes Altmanninger
4dbb209421 Docs: escape word characters after backticks
[ci skip]
2019-11-01 19:11:51 +01:00
Fabian Homborg
9380b7ff39 history: Use --contains by default for "delete"
This just makes more sense, as people don't want to enter exact
matches if they delete interactively.

It also brings it in line with "search".

Fixes #6142
Rejects #6070
2019-11-01 08:53:24 +01:00
David Adam
d2b814bb7c docs: add link for explanation of escape key in bind documentation 2019-10-31 21:12:58 +08:00
Oleg Butuzov
0ec278d6bc Fixing broken link to bind.html 2019-10-31 21:06:14 +08:00
Johannes Altmanninger
5ce4cb66d3 fix stale doc
[ci skip]
2019-10-28 18:36:22 +01:00
ridiculousfish
2a92e66902 Support for &> and &| as convenience redirections
This adds support for &> and &| syntax, which both redirect stdout, and
also apply a redirection of stderr to stdout.
2019-10-27 15:24:57 -07:00
Bruno Heridet
655f7c8c63 doc: add link to echo in printf command
[ci skip]
2019-10-24 21:44:53 +02:00
LawAbidingCactus
305a657694 fix typos 2019-10-23 19:38:44 +02:00
Johannes Altmanninger
aa1bf9f277 sphinx: honor changes in static html assets
Also fix custom.css.
2019-10-19 14:52:24 +02:00
Delapouite
a2672dea7a doc: fix links pointing to history-search section
[ci skip]
2019-10-17 21:45:36 +02:00
Johannes Altmanninger
466b6e1b43
Merge pull request #6207 from krobelus/sphinx-toc
sphinx: highlight current page in the site navigation
2019-10-16 11:19:27 +02:00
Delapouite
e3caaed73f doc: add links between dirs, pushd and popd
[ci skip]
2019-10-16 09:05:59 +02:00
Johannes Altmanninger
cff721afda sphinx: highlight current page in the site navigation
Fixes #6189
2019-10-15 22:25:23 +02:00
Bruno Heridet
38eb7129d3 doc: add links to bg, fg and jobs in disown command
[ci skip]
2019-10-15 12:57:01 -07:00
Mark Stosberg
087500e7b9 doc: document relative path support for source.
[ci skip]
2019-10-14 18:58:30 +02:00
Delapouite
09a97528a9 doc: add cross-refs between if and else commands 2019-10-10 18:17:10 +02:00
Bruno Heridet
7dbbd16d0a doc: add missing down-line and up-line (#6177)
[ci skip]
2019-10-08 18:01:32 +02:00
Bruno Heridet
9c651d7db0 doc: add link to feature flags in fish command
[ci skip]
2019-10-07 17:15:39 +02:00
Fabian Homborg
e5c84e63b6 Document prepend-sudo
[ci skip]
2019-10-06 15:22:25 +02:00
Bruno Heridet
26adff3378 doc: add link to event handlers in emit
[ci skip]
2019-10-06 15:09:01 +02:00
domdom
0fdad2dd6a doc: mention history prefix search binds in binds.rst
Mention history-prefix-search-forward and history-prefix-search-backward in
binds.rst
2019-10-06 15:03:11 +02:00
David Adam
9516fa5017 complete: document change in 22ce8c23c6 2019-10-04 07:13:17 +08:00
Bruno Heridet
b9a22c7136 doc: mention $fish_function_path in the Autoloading Functions section - fix #3371
[ci skip]
2019-10-03 19:39:58 +02:00
Bruno Heridet
0df464ca2c doc: mention the disown command in the jobs section - fix #5530 2019-10-02 18:34:53 +02:00
Bruno Heridet
f1baa514a8 doc: add ref to cmd-breakpoint
[ci skip]
2019-10-02 15:53:22 +02:00
Fabian Homborg
23cd8268f2 docs: Fix universal variables link
[ci skip]
2019-09-30 16:02:06 +02:00
ridiculousfish
d7c695114a Switch from subprocess.run to subprocess.check_call
Restores Python 2 compatibility in conf.py
2019-09-21 12:04:21 -07:00
ridiculousfish
56c0b99799 Format conf.py with black 2019-09-21 11:58:58 -07:00
David Adam
3b8505bebe sphinx: get version number from built binary 2019-09-19 15:05:39 +08:00
David Adam
e6d6c5c5c7 docs: improve realpath documentation 2019-09-17 20:48:22 +08:00
David Adam
02d82dcf85 docs: update all command synopsis formatting
Adds synopses for those commands missing them.

Moves all synopsis sections to code blocks. This improves the appearance, although highlighting as
fish code may not be the ideal appearance.
2019-09-17 17:59:04 +08:00
David Adam
c93c66f76b docs: fix formatting in prompt_pwd manual 2019-09-17 17:31:47 +08:00
David Adam
605885f851 docs: whitespace cleanup in source
Fixes some lint warnings.
2019-09-17 17:28:19 +08:00
David Adam
f11ee26aae docs: slight grammar improvement in source docs
[ci skip]
2019-09-17 16:37:35 +08:00
David Adam
4265b02eb3 docs: standardise on exit status terminology
Exit status is used in the POSIX specification and is preferred over return code/return status/exit
code.

[ci skip]
2019-09-17 16:37:01 +08:00
David Adam
2f6c8fb21a docs: source creates a new local scope
Discussed in #4443.
2019-09-17 16:25:12 +08:00
David Adam
737c2d156d history: fixup exact matching by default
Work on #6070. Fixup from 54ed2ad440.
2019-09-11 23:12:10 +08:00
David Adam
e935f5ce89 docs: fix formatting of name of shells
Work on review comments in #5312.

[ci skip]
2019-09-11 12:25:27 +08:00
David Adam
ccdef3936f docs: improve introduction section
Work on review comments in #5312.
2019-09-11 12:20:08 +08:00
Fabian Homborg
4c656dd43e docs/fish_git_prompt: showupstream is a proper list
"space-delimited" sounds like you'd set it like `set
__fish_git_prompt_showupstream "auto verbose"`. This will not work.

It's a real actual proper list, which aren't space-delimited.

[ci skip]
2019-08-23 19:35:39 +02:00
LawAbidingCactus
1a361cd3ff specify that __fish_git_prompt_describe_style only takes one argument 2019-08-23 10:25:58 -07:00
LawAbidingCactus
ea041e6668 specify that __fish_git_prompt_showupstream takes multiple arguments 2019-08-23 10:25:58 -07:00