Commit Graph

15173 Commits

Author SHA1 Message Date
Aaron Gyes
4a6dbe0922 prompt_* functions: shorten their descriptions 2022-01-22 20:06:37 -08:00
Jeff Dickey
af11a628f9 git diff --quiet has no "-q" flag
https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---quiet
2022-01-22 13:17:11 +08:00
Dundar Göc
fe21cb44c9 entr 2022-01-21 18:11:48 -08:00
Dundar Göc
e8af17c191 lpadmin 2022-01-21 18:11:48 -08:00
Dundar Göc
864f5ca254 lpstat 2022-01-21 18:11:48 -08:00
Dundar Göc
954de44414 mocp 2022-01-21 18:11:48 -08:00
Dundar Göc
f45ca4aca4 completions(postgresql): shorten descriptions 2022-01-21 18:11:48 -08:00
Dundar Göc
cd52937771 completions(sass): shorten descriptions 2022-01-21 18:11:48 -08:00
Dundar Göc
48e686dae2 completions(latexmk): shorten descriptions 2022-01-21 18:11:48 -08:00
Dundar Göc
095aed64e0 completions(imagemagick): shorten descriptions 2022-01-21 18:11:48 -08:00
Dundar Göc
7667a51d93 completions(cdrecord): shorten descriptions 2022-01-21 18:11:48 -08:00
Dundar Göc
3bad45a933 completions(bison): shorten descriptions
Work on https://github.com/fish-shell/fish-shell/issues/6981
2022-01-21 18:11:48 -08:00
Aaron Gyes
9c1723863d
Update CHANGELOG.rst 2022-01-21 14:28:49 -08:00
Aaron Gyes
0d5651b0ab .pkg scripts: remove old installs, fix install volume, logging
+ Adds a preinstall script to wipe out whatever the last .pkg
   installed. This should avoid systems that have mad many updates
   getting into strange states autoloading things that no longer
   exist. Fixes #2963

 + Run add-shell with ${DSTVOLUME} prepended to the path - the
   installer lets users intall onto any volume, so it's plausible
   not installed onto /

 + Use `logger` instead of rando /tmp files for logging - stuff
   should show up in Console.

 + make_pkg makes the pkg and also fish.app - the former was being
   built with -j12 already, make the latter do so as well.
2022-01-21 14:01:06 -08:00
Fabian Homborg
f40c054a6a Replace hangul hack with widecharwidth version
This updates widecharwidth to
6d3d55b419db93934517cb568d1a3d95909b4c7b, which includes the same
Hangul Jamo check in a separate table.

This should slightly speed up most width calculation because we no
longer need to do it for most chars, including the overwhelmingly
common ascii ones.

Also the range is increased and should better match reality.
2022-01-21 17:10:52 +01:00
Mahmoud Al-Qudsi
372f03ba20 Fix sys/sysctl.h depreciation error under glibc 2.30+
glibc 2.30 and up emit an ugly depreciation warning on
`#include <sys/sysctl.h>` - this patch makes the build system fail the
include test for `sys/sysctl.h` by forcibly setting `-Werror` before the
call to `check_include_files` (which internally uses `try_compile`) to
get `HAVE_SYS_SYSCTL` to not be defined (even if it's there) if it would
cause such a depreciation message to be emitted.

Ideally, we would not have to manually massage `CMAKE_C_FLAGS` before
calling `check_include_files` and could just tweak that to either always
or conditionally try compilation with `-Werror`, but try_compile doesn't
actually use any overridden `CMAKE_C_FLAGS` values [0] (dating back to
2006).

[0]: https://cmake.org/pipermail/cmake/2006-October/011649.html
2022-01-20 11:04:40 -06:00
Fabian Homborg
02241d19be CHANGELOG More ignores 2022-01-20 17:15:34 +01:00
Fabian Homborg
b74f610a47 completions/gcc: Some small fixes
Remove some nonexistent options (my gcc does not know "-mdata"), fix
the longest description in all of fish and remove some argument
markers from the option.
2022-01-20 17:14:38 +01:00
Dundar Göc
157d8cfd74 completions(ant): shorten descriptions 2022-01-20 10:49:40 +01:00
Dundar Göc
8878e990a4 completion(ansible-playbook, ansible): shorten descriptions 2022-01-20 10:48:41 +01:00
Dundar Göc
87ce317716 completion(animate): shorten descriptions 2022-01-20 10:48:08 +01:00
Aaron Gyes
401d302179 :Revert "Remove CheckIncludeFiles.cmake"
This reverts commit 398f3213d2.
2022-01-19 11:41:16 -08:00
Aaron Gyes
398f3213d2 Remove CheckIncludeFiles.cmake
We apparently vendored it for the sake of attempting to support
old cmake versions:
7aefaff298.
"This file can be dropped once the minimum version of CMake for fish is 3.11.0"

So, drop it like it's hot.
2022-01-19 11:38:41 -08:00
Fabian Homborg
9d59254a72 themes: Resolve pager_selected_background
This sets the variable to the background value of
$fish_color_search_match, which fixes the case where you switch from a
theme with a set selected background (like our default, now) to one without.
2022-01-19 17:54:59 +01:00
Fabian Homborg
24f9fdd0a7 themes/default: Set pager selection to reverse
This makes it look okay on both light and dark backgrounds.
2022-01-19 17:23:42 +01:00
Johannes Altmanninger
2a98b7a593 docs synopsis: make all placeholder arguments uppercase
man(1) uses lowercase placeholders but we usually don't.  Additionally,
the new synopsis autoformatting only recognizes placeholders if they
are uppercase. Use uppercase for all placeholders.
2022-01-19 22:56:41 +08:00
Johannes Altmanninger
c0d1e41313 docs synopsis: add HTML highlighing and automate manpage markup
Recent synopsis changes move from literal code blocks to
[RST line blocks].  This does not translate well to HTML: it's not
rendered in monospace, so aligment is lost.  Additionally, we don't
get syntax highlighting in HTML, which adds differences to our code
samples which are highlighted.

We hard-wrap synopsis lines (like code blocks). To align continuation
lines in manpages we need [backslashes in weird places]. Combined with
the **, *, and `` markup, it's a bit hard to get the alignment right.

Fix these by moving synopsis sources back to code blocks and compute
HTML syntax highlighting and manpage markup with a custom Sphinx
extension.

The new Pygments lexer can tokenize a synopsis and assign the various
highlighting roles, which closely matches fish's syntax highlighing:
- command/keyword (dark blue)
- parameter (light blue)
- operator like and/or/not/&&/|| (cyan)
- grammar metacharacter (black)

For manpage output, we don't project the fish syntax highlighting
but follow the markup convention in GNU's man(1):

	bold text          type exactly as shown.
	italic text        replace with appropriate argument.

To make it easy to separate these two automatically, formalize that
(italic) placeholders must be uppercase; while all lowercase text is
interpreted literally (so rendered bold).
This makes manpages more consistent, see string-join(1) and and(1).

Implementation notes:
Since we want manpage formatting but Sphinx's Pygments highlighing
plugin does not support manpage output, add our custom "synopsis"
directive.  This directive parses differently when manpage output is
specified. This means that the HTML and manpage build processes must
not share a cache, because the parsed doctrees are cached.  Work around
this by using separate cache locations for build targets "sphinx-docs"
(which creates HTML) and "sphinx-manpages".  A better solution would
be to only override Sphinx's ManualPageBuilder but that would take a
bit more code (ideally we could override ManualPageWriter but Sphinx
4.3.2 doesn't really support that).

---

Alternative solution: stick with line blocks but use roles like
:command: or :option: (or custom ones). While this would make it
possible to produce HTML that is consistent with code blocks (by adding
a bit of CSS), the source would look uglier and is harder to maintain.
(Let's say we want to add custom formatting to the [|] metacharacters
in HTML.  This is much easier with the proposed patch.)

---

[RST line blocks]: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#line-blocks
[backslashes in weird places]: https://github.com/fish-shell/fish-shell/pull/8626#discussion_r782837750
2022-01-19 22:56:41 +08:00
Johannes Altmanninger
1c21e26d08 docs: load custom lexer with plain Python import
The next commit will load another of our Python extensions from a
separate file. That extension will contain more than just a Pygments
lexer, so instead of using a function that can only load a lexer,
just import from the module to keep things consistent.
2022-01-19 22:56:41 +08:00
Fabian Homborg
89e85e05e0 completions/git: Add add --chmod option
Fixes #8652.
2022-01-18 19:20:27 +01:00
Fabian Homborg
f612ade5d9 CHANGELOG for 3.4.0 2022-01-18 18:09:29 +01:00
Pablo Santiago Blum de Aguiar
6315cf67ec Assert and and or create no new scope 2022-01-18 17:56:33 +01:00
David Adam
a22779e807 CHANGELOG: work on 3.4.0 2022-01-18 23:34:50 +08:00
Dundar Göc
48652eebc1 completion: add completions for topgrade 2022-01-18 23:33:52 +08:00
dundargoc
9b3783d54a
completions: shorten descriptions for p4 (#8647)
Work towards #6981
2022-01-17 11:06:05 -08:00
Fabian Homborg
0127b237e7 completions/git: Complete heads for push
Fixes #8650
2022-01-17 17:49:00 +01:00
Jakub Panek
d5076572c8 completions(apk.fish): force file/parameter completion
Signed-off-by: Jakub Panek <me@panekj.dev>
2022-01-17 06:48:54 +01:00
ridiculousfish
1f8ce5ff6c Stop ignoring initial command in read -c
`read` allows specifying the initial command line text. This was
text got accidentally ignored starting in a32248277f. Fix this
regression and add a test.

Fixes #8633
2022-01-16 13:36:48 -08:00
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