Commit Graph

15136 Commits

Author SHA1 Message Date
Max Nordlund gmail
49a0362c12 Fix nmap --script completion
It's using GNU specific flags, which doesn't work on BSDs like macOS.

Instead this just formats the current time into
seconds and then the `math` builtin for calculating the 5 min timeout.
2022-01-16 15:13:57 +01:00
Johannes Altmanninger
04a905961d completions/conda.fish: use __fish_is_first_token
Closes #8614
2022-01-16 15:02:53 +01:00
Johannes Altmanninger
557d8b0334 docs: restore default highlighting keywords and options in HTML
Keywords and options recently got dedicated highlighting roles in
b3626d48e (Highlight keywords differently, 2021-02-04) and
711796ad1 (Highlight options differently, 2021-10-19)
but still default to "command" and "parameter", respectively.

The dedicated roles were not colored by our CSS theme,
which makes a "test -f foo.txt" look weird:
- "test" is dark blue (since it's a command)
- "foo.txt" is light blue (since it's a parameter)
- "-f" is black (weird!)

The CSS theme doesn't support configuration, so the dedicated
highlighting roles should always default to their fallback
options. Make it so.
2022-01-16 14:07:19 +01:00
Johannes Altmanninger
7aa0f4a2cf test.rst: fix runaway space 2022-01-16 14:06:40 +01:00
Johannes Altmanninger
97db9d5c38 docs synopses: fix alignment of continuation lines
This corrects what looks like wrong alignment of some synopsis lines.
(I think the alignment is not a bad idea but it makes us do more
manual work, maybe we can automate that in future.  We still need to
figure out how to translate it to HTML.)

"man -l build/user_doc/man/man1/history.1" before:

	string match [-a | --all] [-e | --entire] [-i | --ignore-case]
	            [-r | --regex] [-n | --index] [-q | --quiet] [-v | --invert]
	            PATTERN [STRING…]

and after:

	string match [-a | --all] [-e | --entire] [-i | --ignore-case]
	             [-r | --regex] [-n | --index] [-q | --quiet] [-v | --invert]
	             PATTERN [STRING…]

Also make the lines align the same way in the RST source by carefully
choosing the position of the backslash. I'm not sure why we used
two backslashes per line. Use only one; this gives us no choice
of where to put it so both source and man page output are aligned.
Change tabs to spaces to make the alignment in the source work.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
18467457c6 docs synopses: do not add markup to the ellipsis character
The ellipsis is a grammar metacharacter, just like the []()|.
Write *FOO*… instead of *FOO…*, so the ellipsis is not underlined
in the man page. Not super sure about this one.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
78101364c3 docs synopses: remove unconventional spaces inside [] and ()
We usually write "[a | b]", not "[ a | b ]".
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
ad4530acd3 docs synopses: add space before ellipsis
This matches the style in man(1) (except that we use the … ligature).

A previous iteration did the reverse (never use a space before the
ellipsis). That would be a smaller change.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
be451091d4 docs synopses: use ellipsis with singular words
We use plural "*OPTIONS*" more often than "*OPTION*...", so let's do
that everywhere.

In some other places where we do have an ellipsis, make sure to use
singular, since the ellipsis already means repetition.  This change
is incomplete, and I'm not sure if this is worth it, since it's
subjective, so I might drop it.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
f8e8c23ac3 docs synopses: use parenthesis to indicate that short/long option pairs take same args
Matches Git, see for example the -O option in git-grep(1).
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
4a4905aaa5 docs synopses: fix RST syntax 2022-01-16 14:05:47 +01:00
Johannes Altmanninger
adccd6e6f5 function.rst: remove ellipsis since there is no repetition
Alternatively we could say *COMMANDS*... or similar.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
851512a7cc complete.rst: clarify in synopsis that -c/-p take an argument
Correct the grammar by moving the options after the command argument.
Also group the -c/--command and -p/--path pairs, to convey that the
short and long variants are equivalent.

While at it, consolidate the -C/--do-complete forms, like we usually
do.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
115615b831 psub.rst: add long option to synopsis 2022-01-16 14:05:47 +01:00
Johannes Altmanninger
d9287ec471 set.rst: fix synopsis glitch and make placeholder uppercase
One synopsis misrenders as

    set [options] VARIABLE*[*INDICES]… VALUES…

Add a missing backslash to fix that.  Also go back to uppercase
because I'm not sure why this was changed to lowercase.

Finally, remove the spurious ellipsis after VARIABLE[INDICES].
This element cannot be repeated. Multiple index values and ranges
can be specified but that's already implied by the plural INDICES.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
dd8351d1b4 history.rst: fix BNF syntax for orthogonal options
These can be used alone, or in combination, let's reflect that in
the synopsis.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
a7f45b05b7 history.rst: fix wrong subcommand name and unconventional braces
For alteration we usually use "(a | b)", not "{a | b}".

While at it, instead of writing 4/6 subcommands in one line, write them
on separate lines, so it's very obvious that all these are separate
subcommands. We mainly use the (a | b) syntax for long/short options.
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
0d6bad9660 history.rst: don't mention the --show-time option for "history delete"
It's ignored.  We could support it in future (and maybe throw an
"unsupported" error until then).
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
19aebebb95 math.rst: remove stray mention of -- separator from synopsis
The -- is not special here and we don't mention it in other synopses.

It was originally added for a good reason in 98449fec5 (fix `math`
regression, 2017-07-14), along this addition to math.rst:

> You should always place a `--` flag separator before the expression. [...]

However, since 56d913453 (Cache math expressions, 2017-08-24) that
line was changed to

> You don't need to use `--` before the expression even if it begins with a minus sign [...]
2022-01-16 14:05:47 +01:00
Johannes Altmanninger
6df86c6c23 math.rst: use 4 spaces instead of a tab for indentation
I personally prefer tabs but we always use spaces, so this is much
less surprising.
2022-01-16 14:05:47 +01:00
Fabian Homborg
698b818935 Shorten default title
This now skips the "fish" bit and uses prompt_pwd to print a shorter title.

See #8641.
2022-01-16 11:17:31 +01:00
Fabian Homborg
ca12ce2494 CHANGELOG 2022-01-15 12:22:11 +01:00
Fabian Homborg
0781473564 argparse: Jump to the next option after an unknown one
Previously, when we got an unknown option with --ignore-unknown, we
would increment woptind but still try to read the same contents.

This means in e.g.

```
argparse -i h -- -ooo -h
```

The `-h` would also be skipped as an option, because after the first
`-o` getopt reads the other two `-o` and skips that many options.

This could be handled more extensively in wgetopt, but the simpler fix
is to just skip to the next argv entry once we have an unknown option
- there's nothing more we can do with it anyway!

Additionally, document this and clearly explain that we currently
don't transform the option.

Fixes #8637
2022-01-15 12:17:43 +01:00
Fabian Homborg
8e60f1b4a3 docs: Set doc language
This sets the html lang= attribute, which should be useful for
accessibility (screenreaders).
2022-01-14 18:54:01 +01:00
Fabian Homborg
e27456df24 css: Use same font for headers
For some reason classic.css gives these a special font. Let's just
pick the body font again.
2022-01-13 19:25:44 +01:00
Fabian Homborg
7a3594d840 docs: Increase contrast in dark theme for header/footer
This was flagged by one of those WCAG checkers, and there's no real
reason to introduce another color here.
2022-01-13 17:07:04 +01:00
Fabian Homborg
58cf5f249a Document font changes 2022-01-13 16:25:45 +01:00
Fabian Homborg
9220b96531 Make inline code color a little bluer 2022-01-13 16:23:54 +01:00
Fabian Homborg
e2157d09df Add a background and some padding to inline-code
This allows it to be distinguished not just based on the font.

Not adding a border because that's a bit much.
2022-01-13 16:23:54 +01:00
Fabian Homborg
30dc91225e css: Pick nicer fonts
Unfortunately the normal font families like "sans-serif" and
"monospace" are basically broken because the browser defaults are
decades old.

TODO: Inline code is barely distinguishable.
2022-01-13 16:23:54 +01:00
Fabian Homborg
cc796e4dfc Webconfig: Remove unused font declaration
This was for <code> tags, which we don't have here. The rest is
already all monospace and Source Code Pro has bugs on macOS.
2022-01-13 16:23:54 +01:00
Fabian Homborg
9eb1b7a9ae Revert "index.rst: don't mention current page under "Other help pages""
Unfortunately this removes the index also from the sidebar in other pages. This makes it basically inaccessible.

Maybe there is a way to not show it in the list at the bottom, but this isn't it. Maybe a manual list of pages instead of reusing the TOC?

This reverts commit b5a95317f0.
2022-01-12 21:42:16 +01:00
Fabian Homborg
c6fa2ec82f
Doc theme: Stop picking specific code fonts again
d54c8a42a9 reintroduced #7714 by picking Source Code Pro again, which is *broken* on MacOS.
2022-01-12 12:48:14 +01:00
Spenser Black
6ef726b285
Include tags in git push completions (#8630)
Resolves #8621
2022-01-11 21:27:23 +01:00
Fabian Homborg
1eb58f9054 Tests: Merge "notifiers" and "universal" groups
The sole notifiers test recreated the uvar directory, so if it was
called while the universal test was running it would stop it from
completing correctly.

This happened reasonably often on Ubuntu with tsan on Github Actions.
2022-01-09 23:26:33 +01:00
David Adam
5ee389592c Bump copyright year 2022-01-09 23:47:58 +08:00
David Adam
b49dd30179 builtins/block: correct an errant comment 2022-01-09 22:00:58 +08:00
David Adam
50dc826d7d CHANGELOG: work on 3.4.0 2022-01-09 08:44:01 +08:00
ridiculousfish
c1a1b70203 macOS: Specify hostArchitectures in osx_distribution.xml
This allows the installer to work without Rosetta 2 on Apple Silicon
Macs. Note that fish shell itself has run natively since 3.3.1 but the
installer still wanted Rosetta 2, because this key was missing.

Fixes #8566. Credit to floam for finding missing key.
2022-01-08 11:31:23 -08:00
ridiculousfish
667057cb0d macOS: go back to using Apple-provided productsign
Previously we used a hacked up 'xar' tool for signing packages,
since productsign produced a package that could not be installed on
macOS 10.11. That was fixed in Xcode 12.5 so we can just use Apple's
tools again.

See #7656.
Also see https://developer.apple.com/forums/thread/664842
2022-01-08 11:31:23 -08:00
exploide
49a9610c31 completions: complete users for id command and added two further options 2022-01-08 13:51:52 +01:00
Kid
aa6e0cc157
Skip more leading commands in __fish_man_page (#8612)
* Skip leading `xargs` in `__fish_man_page`

* Complete the list

* `git` does not qualify either
2022-01-08 13:50:31 +01:00
Kid
491dd92ac2
Add isatty completion (#8609)
* Add `isatty` completion

* Keep order
2022-01-08 13:46:54 +01:00
Kid
8aa2857c43 Clarify functions -Dv's output 2022-01-08 13:46:00 +01:00
David Adam
ec4eccce34 CHANGELOG: work on 3.4.0 2022-01-07 00:09:02 +08:00
David Adam
b4e8e5abff __fish_print_apt_packages: stringify
GNU tr is not Unicode-aware, and was corrupting descriptions that had
non-ASCII characters.

Additionally, rather than using the Unicode private use characters, use
the ASCII/UTF-8 record separator character as it was intended.

The sed command could probably be rewritten to do all the heavy lifting
here, but would be even less readable.

Closes #8575.
2022-01-06 23:55:18 +08:00
Fabian Homborg
41da16408a sample_prompts/disco: Actually use luminance for dir color
Instead of weirdly smearing the color, simply increase the values
until they are bright enough.

This prevents /tmp from being white, and guarantees visible colors for
all directories.
2022-01-05 18:14:24 +01:00
David Adam
a7b4fc3845 CHANGELOG: work on 3.4.0 2022-01-05 00:24:41 +08:00
David Adam
bd7edbcf50 Revert "Work on CHANGELOG for 3.4 (#8601)"
This reverts commit 935ec39668.

8403 was already in the ignore list and subcommands are not usually
included in the new completion list.
2022-01-04 22:35:43 +08:00
Kid
a0c2be5fc3 Fix xargs option completions 2022-01-04 19:02:08 +08:00