Commit Graph

116 Commits

Author SHA1 Message Date
Fabian Homborg
97507a24a2 Increase default read limit to 100MiB
Someone has hit the 10MiB limit (and of course it's the number of
javascript packages), and we don't handle it fantastically currently.

And even though you can't pass a variable of that size in one go, it's
plausible that someone might do it in multiple passes.

See #5267.
2019-05-29 11:01:45 +02:00
ridiculousfish
63a16befd4 Introduce the fish log, a replacement for debug()
This adds a new mechanism for logging, intended to replace debug().

The entry points are FLOG and FLOGF. FLOG can be used to log a sequence of
arguments, FLOGF is for printf-style formatted strings.

Each call to FLOG and FLOGF requires a category. If logging for a category
is not enabled, there is no effect (and arguments are not evaluated).

Categories may be enabled on the command line via the -d option.
2019-05-27 17:24:52 -07:00
Fabian Homborg
cf9b2ff1e5 docs/tutorial: Fix prompt display
This displays a colored prompt, which we emulate by adding explicit
roles that are translated to css classes.

For other things, like "eror" this might not be enough because those
often need the rest of the line to still be styled, and I've not found
a way to add some explicit styling to a code block.

See #5696.

[ci skip]
2019-05-25 11:47:44 +02:00
Fabian Homborg
fae15535db docs/tutorial: Don't accidentally make a multiline prompt
Fixes #5890.

[ci skip]
2019-05-24 20:58:43 +02:00
Fabian Homborg
c2b7e9b2e6 fish_indent: Allow multiple file arguments
Allows `fish_indent -w **.fish` to restyle all fish files under the
current directory.

(This also has the sideeffect of reducing style.fish time by ~10s, as
we only need to invoke `fish_indent` once, instead of once per-file)
2019-05-20 21:04:51 +02:00
Fabian Homborg
257c72d8be Document string split superpowers more
[ci skip]
2019-05-19 19:40:48 +02:00
Fabian Homborg
967c1d51ee Only do brace expansion if they contain a variable or ","
Brace expansion with single words in it is quite useless - `HEAD@{0}`
expanding to `HEAD@0` breaks git.

So we complicate the rule slightly - if there is no variable expansion
or "," inside of braces, they are just treated as literal braces.

Note that this is technically backwards-incompatible, because

    echo foo{0}

will now print `foo{0}` instead of `foo0`. However that's a
technicality because the braces were literally useless in that case.

Our tests needed to be adjusted, but that's because they are meant to
exercise this in weird ways.

I don't believe this will break any code in practice.

Fixes #5869.
2019-05-19 18:23:27 +02:00
Fabian Homborg
6e0cf5db6f docs/status: Fix synopsis
[ci skip]
2019-05-14 19:26:52 +02:00
Fabian Homborg
0aead5caf8 Repaint-mode to reexecute the rest if mode-prompt output is empty
We previously checked if fish_mode_prompt existed as a function, but
that's a bad change for those who already set it to an empty function
to have a mode display elsewhere.
2019-05-14 19:26:52 +02:00
David Adam
b0f320481c document kill-path-component stopping at @ or :
Changes from 009ecfd7e6 / #5841.

[ci skip]
2019-05-14 13:18:22 +08:00
Fabian Homborg
3262c5ff44 docs: Document that complete -k does last calls first
Fixes #5868.

[ci skip]
2019-05-10 15:39:17 +02:00
Fabian Homborg
8d9782301e docs: Call "arrays" "lists"
We were flip-flopping between the two terms, so we now use one. We
still mention "array" in the chapter, and it's still `read --array`,
though.

Fixes #5846.

[ci skip]
2019-05-05 14:01:07 +02:00
Fabian Homborg
c2970f9618 Reformat all files
This runs build_tools/style.fish, which runs clang-format on C++, fish_indent on fish and (new) black on python.

If anything is wrong with the formatting, we should fix the tools, but automated formatting is worth it.
2019-05-05 12:09:25 +02:00
Fabian Homborg
05b2d4ee54 Docs: Document path vars more
Fixes #5741.

[ci skip]
2019-04-30 13:18:56 +02:00
Fabian Homborg
17116366dc docs: Remove explicit .html links
Instead, we link to rst labels, which could also work in non-html
output, or if the section ever moves elsewhere.

See #5696.

[ci skip]
2019-04-30 13:11:33 +02:00
Fabian Homborg
1377f71331 docs: Remove some more html
See #5696.

[ci skip]
2019-04-30 12:56:30 +02:00
Fabian Homborg
03431ae9a2 docs: Default to fish highlighting
This fixes highlighting in cmds/.

See #5696.

[ci skip]
2019-04-30 12:49:04 +02:00
Fabian Homborg
d8f922fd70 docs: Remove <outp> tags
fish_indent_lexer formats lines not starting with a prompt indicator
as output, as long as there is a prompt indicator elsewhere.

So these tags are useless and wrong.

See #5696.

[ci skip]
2019-04-30 12:44:55 +02:00
Fabian Homborg
6f45b8d632 docs/fish_indent_lexer: Support >_ as prompt indicator
This was widely used in the old docs, and currently it just allowed `>`.

See #5696.

[ci skip]
2019-04-30 12:44:49 +02:00
Fabian Homborg
e8fd83ca25 docs/index: Remove wrong "configuration variables"
Hat-tip to @enzotib on gitter.

[ci skip]
2019-04-29 21:19:43 +02:00
Fabian Homborg
8c9359fdd4 src/builtin_argparse: Add --ignore-unknown flag
This keeps all unknown options in $argv, so

```fish
argparse -i a/alpha -- -a banana -o val -w
```

results in $_flag_a set to banana, and $argv set to `-o val -w`.

This allows users to use multiple argparse passes, or to simply avoid
specifying all options e.g. in completions - `systemctl` has 46 of
them, most not having any effect on the completions.

Fixes #5367.
2019-04-29 15:57:56 +02:00
Fabian Homborg
af0e08e9f1 argparse: Use the current function name by default
This makes the `--name` option usually unnecessary.

See #5835.
2019-04-27 15:55:49 +02:00
Fabian Homborg
eb0e0a4ab4 docs/argparse: Fix links
Fixes #5847.

[ci skip]
2019-04-27 12:16:53 +02:00
Fabian Homborg
e084d097d5 docs: Remove <asis> markup
This isn't needed anymore.

[ci skip]
2019-04-26 19:25:30 +02:00
Fabian Homborg
ff62f2ae08 docs/bind: Document path-component and word
Plus fix some formatting.

[ci skip]
2019-04-26 19:23:24 +02:00
David Gowers
38cadc9d4f Variables as commands are in fact supported, eval docs should not claim otherwise. (#5819)
Provide an example that somewhat justifies eval's existence in light of this change.

Also correct similar misinformation found in a comment.
2019-04-26 15:30:13 +02:00
David Adam
2ca1bc433f fish_indent_lexer: explicitly encode/decode bytes over pipe
Universal newlines behaves differently between Python 2.7 and 3.x,
leading to problems when running Sphinx with Python 2.7.

fish_indent always uses \n, so there's no need to use universal newline
detection.

This also allows full UTF-8 in documentation sources.

Closes #5808.
2019-04-12 23:10:53 +08:00
Fabian Homborg
b0388ed488 docs: Workaround bug with python2-sphinx
It can't handle a `→` literal inside code blocks. Since we only have
two of those, let's just replace them with `=>`.

Fixes #5808.
2019-04-12 08:46:41 +02:00
David Adam
87518a524f docs: update the VCS prompt function documentation
Edited for clarity and formatting.

[ci skip]
2019-04-11 23:51:47 +08:00
David Adam
c50eb7c85f docs: import SphinxWarning in configuration
Fixes a NameError when reporting problems.

[ci skip]
2019-04-11 23:51:38 +08:00
ridiculousfish
b6555a0dc4 Add print-rusage-self to fish
This adds an option --print-rusage-self to the fish executable. When set,
this option prints some getrusage stats to the console in a human-readable
way. This will be used by upcoming benchmarking support.
2019-04-10 14:33:45 -07:00
Fabian Homborg
8f1b240289 docs: Slight touchup on brace expansion
Clarify the "literal {}" bit and fix formatting.

[ci skip]
2019-04-10 18:04:07 +02:00
Fabian Homborg
83e72c912d docs: Put "Some common words" first
Before all the sections that use these, it seems useful to explain the
common words _first_.

[ci skip]
2019-04-10 17:20:02 +02:00
Fabian Homborg
774d46e180 docs: :ref: more
[ci skip]
2019-04-10 17:19:56 +02:00
Fabian Homborg
151170280a docs: Explain ?s status better
[ci skip]
2019-04-10 17:19:48 +02:00
Fabian Homborg
b0102a0809 docs: Spruce up copy and paste section
[ci skip]
2019-04-10 17:19:48 +02:00
Fabian Homborg
add0bd0538 docs: Fix refs to cartesian product
There's an explicit label for "cartesian-product", but the title is
"Cartesian Product*s*". So linking via with `thing <#link>`_ links the
title, so without the "s" it doesn't work.

From what I know, linking via :ref:`thing <label>` is preferred and
works better with other exports and across files?

I think I should take a doc holiday.

[ci skip]
2019-04-09 14:06:54 +02:00
Fabian Homborg
e9f2a2904b Update the year of the doc
Next I'm gonna join the Temple Of The Doc.

[ci skip]
2019-04-09 13:58:59 +02:00
Fabian Homborg
5aed0bbf88 docs: Remove underline for whitespace
This made it look like code was `echo_Hello_World` instead of `echo
Hello World`.

See #5696.

[ci skip]
2019-04-09 13:57:36 +02:00
Fabian Homborg
c2259cbb86 docs: Fix typo
Also removes a warning.

[ci skip]
2019-04-09 13:47:54 +02:00
ridiculousfish
1fb05d8fa0 Add fish specific css to docs 2019-04-08 19:13:58 -07:00
ridiculousfish
e85cb25883 Switch to fish_indent based syntax highlighting in sphinx docs 2019-04-08 19:11:22 -07:00
ridiculousfish
5b2c741f6c Add fish_indent_lexer.py
This is a pygments lexer that shells out to fish_indent
2019-04-08 19:09:53 -07:00
Fabian Homborg
4d66c7896f docs: Fix some more formatting
One monster paragraph and two lists that weren't recognized as such.

RsT loves empty lines.

[ci skip]
2019-04-06 23:38:07 +02:00
Fabian Homborg
a447878cd7 docs: Remove &foo; escapes
I always hated these.

[ci skip]
2019-04-06 23:33:07 +02:00
Fabian Homborg
c4d0177d81 docs: Put some more important variables first
This section was linked when talking about $PATH, and $PATH is much
more important than $fish_color_something and $fish_emoji_width.

[ci skip]
2019-04-06 23:29:05 +02:00
Fabian Homborg
235266894b docs: Fix reference to FAQ
This adds a reference to one specific FAQ, so it adds a label for that
one question. It does not add the rest, because they currently aren't
linked. If you add a reference to an FAQ, you should add the label as
well.

[ci skip]
2019-04-06 23:23:48 +02:00
Fabian Homborg
f1614a995a docs: Reword commandline -f
We don't refer to "readline functions" anywhere else, and "injecting"
them "into the reader" is an overly jargony way of expressing it that
only makes sense to someone familiar with the internals. And even then
the term "readline" is already taken by the "readline" library, used
by bash et al, but not by us.

So we pick the term "input functions", like we did in bind.

See https://stackoverflow.com/questions/55542839/what-does-commandline-f-repaint-in-fish-shell/55543411#55543411.

[ci skip]
2019-04-06 20:39:16 +02:00
Fabian Homborg
21ef9f5150 docs: Remove fish_vi_mode documentation
This has been deprecated for quite a while, no need to keep the docs around.

[ci skip]
2019-04-05 14:09:41 +02:00
Fabian Homborg
357a572b43 docs/index: Document repaint-mode
This was only mentioned in passing in the bind docs.

[ci skip]
2019-04-05 14:08:58 +02:00