Commit Graph

224 Commits

Author SHA1 Message Date
Fabian Homborg
6da4b682db docs: Separate scripting/interactive sections
[ci skip]
2019-12-10 21:05:21 +01:00
Fabian Homborg
b491e2bbfc docs: Turn some sections into subsections
[ci skip]
2019-12-10 21:01:09 +01:00
Fabian Homborg
ea7868988a docs: Remove "simple"
This just reads condescending. The user can decide for themselves how
simple something is.

[ci skip]
2019-12-10 19:05:37 +01:00
Fabian Homborg
eb7837113f docs: File completion can indeed be enabled again
[ci skip]
2019-12-10 19:03:44 +01:00
Fabian Homborg
8a5eda3e9b docs: Some nits
[ci skip]
2019-12-10 18:47:46 +01:00
Fabian Homborg
2b6b6a0de0 docs: Link tutorial immediately 2019-12-10 18:47:14 +01:00
Fabian Homborg
d05b7614dd Reorder setup instructions
First tell them how to install (though we don't actually do that right
now), then tell them how to start it, and only *then* tell them how to
make it the default or uninstall it.

Just seems sensible to try it first then delete it.
2019-12-10 18:35:25 +01:00
Fabian Homborg
b35eca5d9b docs: Restructure introduction
Some more sections here were duplicated or not all that useful, and
it's weird to start with "Commands versus Functions".

Let's explain to people how to start fish, then let's get going.
2019-12-10 18:29:57 +01:00
Fabian Homborg
023eb48ba7 docs: More rewording
[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
be8aac53a3 docs: Reword range expansion
[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
c12232c24a docs: Some more wording changes
Try to sound more human, and also use footnotes. Footnotes are cool.

[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
607eda7a7a docs: Streamline some of the introductory parts of index.rst
Really "what is a shell" is covered by the part where it says it
offers a commandline interface.
2019-12-09 21:22:37 +01:00
Fabian Homborg
00fc36c3eb docs: Simplify argparse docs
This was a bit stuffy and verbose, so try to make it a tad more human.

Also don't mention `fish_opt` constantly. It's not actually all that
useful as argparse isn't as difficult to use as we thought.

[ci skip]
2019-12-01 18:15:36 +01:00
Fabian Homborg
86133b0a2b Add read --tokenize
This splits a string into variables according to the shell's
tokenization rules, considering quoting, escaping etc.

This runs an automatic `unescape` on the string so it's presented like
it would be passed to the command. E.g.

    printf '%s\n' a\ b

returns the tokens

printf
%s\n
a b

It might be useful to add another mode "--tokenize-raw" that doesn't
do that, but this seems to be the more useful of the two.

Fixes #3823.
2019-12-01 18:14:26 +01:00
Fabian Homborg
1f976a5041 Disavow IRC channel
I don't know of any fish dev on there, so it's not a good channel to
reach us and I have no idea how good it is, so it's best to just ditch it.
2019-11-30 09:29:49 +01:00
David Adam
563bdf3cc7 docs: update isatty documentation to refer to terminals
Use language that is more accurate, similar to what glibc uses.

Closes #6355.
2019-11-26 18:18:16 +08:00
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