Commit Graph

118 Commits

Author SHA1 Message Date
Fabian Homborg
bd8fd9fd0d docs/bind: Document and
[ci skip]
2019-12-25 10:46:46 +01:00
Fabian Homborg
c0f2e842ad Document missing bind functions
Turns out we never documented the "jump" ones.

That means the still-undocumented bind functions are

- vi-arg-digit
- vi-delete-to
- and

Mostly because I'd have to look up what they actually *do*, and
possibly rename them to be generic.

[ci skip]
2019-12-25 10:26:03 +01:00
Dan Martinez
de37e52dca Mention how functions --details handles aliases (#6423)
* Mention how `functions --details` handles aliases

* Clarify that `source` is responsible for `-` paths
2019-12-21 09:59:14 +01:00
Fabian Homborg
17b499d2ea docs/printf: Don't double "%"
This might be a leftover from doxygen, but sphinx does *not* require
"%%" here to print "%", so it shows

    %%d

instead of the correct

    %d

[ci skip]
2019-12-20 17:13:21 +01:00
David Adam
625db1d3f6 docs: add fish_cancel event
Introduced in 2dcaf4f5c0 as part of #5973.

[ci skip]
2019-12-14 22:36:07 +08:00
Dan Martinez
16dc606001 Add the --short flag to type (#6403)
* Add the `--succinct` flag to `type`

* Use `echo` rather than `printf`

* Change `succinct` to `short`; print path if known

* Clean up the printing logic ever so slightly
2019-12-11 22:24:29 +01:00
Fabian Homborg
0b36d94006 docs: Link to the fish-doc and fish-tutorial pages from fish(1)
Just a brief explanation what that page is good for and how to get the
full scoop.

Fixes #5521.

[ci skip]
2019-12-11 20:59:17 +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
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
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
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
Bruno Heridet
655f7c8c63 doc: add link to echo in printf command
[ci skip]
2019-10-24 21:44:53 +02:00
Delapouite
a2672dea7a doc: fix links pointing to history-search section
[ci skip]
2019-10-17 21:45:36 +02:00
Delapouite
e3caaed73f doc: add links between dirs, pushd and popd
[ci skip]
2019-10-16 09:05:59 +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
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
f1baa514a8 doc: add ref to cmd-breakpoint
[ci skip]
2019-10-02 15:53:22 +02: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
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
LawAbidingCactus
b0e9317dd2 document auto option for __fish_git_prompt_showupstream 2019-08-23 10:25:58 -07:00
David Adam
225b1204d6 read: add --list as synonym for --array
Work on #5846.
2019-08-22 21:24:17 +08:00
Miha Filej
ec2ff8de24 docs/bind: Mention history-token-search-*
[ci skip]
2019-07-29 19:08:26 +02:00
David Adam
8bb343879e docs: update set --show synopsis
As reported on the mailing list in Message-ID:
<CAK72cnbc7qW=Meuvr=vBRyok0syFSC5nitsTKUpbs89XpFCoDg@mail.gmail.com>
2019-07-25 20:22:41 +08:00
Mahmoud Al-Qudsi
90882ca9ee [docs] Clarify behavior of --no-scope-shadowing and variable lifetimes 2019-07-13 22:47:04 -05:00
Fabian Homborg
8013686d17 delete-or-exit: Only exit if the commandline is empty
This exitted if the cursor was at the end of the line as well (i.e. if
delete-char failed). That's a bit too eager.

Also documentation, which should have already been included.
2019-07-03 11:48:38 +02:00
Fabian Homborg
d263093a5a docs/cmds/fish: Document private mode there as well
Oversight, see #2376.

[ci skip]
2019-06-30 13:54:54 +02:00
Fabian Homborg
427a18c1ea fish_git_prompt: Add a way to use the informative chars
$__fish_git_prompt_use_informative_chars will use the informative
chars without requiring informative mode (which is really frickin'
slow!).

See #5726.

[ci skip]
2019-06-25 16:11:18 +02:00
Fabian Homborg
9b54a53758
Prevent not-yet-loaded functions from loaded when erased (#5951)
* Prevent not-yet-loaded functions from loaded when erased

Today, `functions --erase $function` does nothing if the function
hasn't been autoloaded yet.

E.g. run, in an interactive session

    > functions --erase ls
    > type ls

and be amazed that it still shows our default `ls --color=auto`
wrapper function.

This seems counter-intuitive - removing a function ought to remove it,
whether it had been executed before or not.

* doc/changelog
2019-06-22 11:08:36 +02:00