Compare commits

...

1655 Commits

Author SHA1 Message Date
David Adam
aabc208318 Release 3.1b1 2020-01-26 21:21:05 +08:00
David Adam
9b6a5b99a9 CHANGELOG: final work towards 3.1b1 2020-01-25 22:42:12 +08:00
David Adam
8ff0c351a9 vendor_*.d: also create these directories in the prefix 2020-01-25 16:12:20 +08:00
David Adam
81306d3b30 vendor_*.d: include /usr/local by default as "extra" directory
Closes #5029.
2020-01-25 16:12:20 +08:00
239
3e08083d49 Add completions for loginctl and resolvectl (#6501)
* Add completions for loginctl and resolvectl

* Add #6501

* Fix optional arguments

* Remove placeholder arguments
Fix expected arguments
2020-01-24 18:27:47 +01:00
Aaron Bieber
903fe9de48 webconfig: Use tempfile instead of ~/.cache (#6522)
OpenBSD uses [unveil(2)](https://man.openbsd.org/unveil) in chromium and
firefox. This means that things outside of directories like ~/Downloads or /tmp are not visible to the
browsers.

Change webconfig so it uses tempfile.NamedTemporaryFile to create our temp file.
2020-01-23 19:52:26 +01:00
ridiculousfish
dbbe8a2da5 Clarify expand_result_t comments 2020-01-22 11:51:40 -08:00
ridiculousfish
2af710f7c0 Eliminate expand_result_t::wildcard_match
This was an internal implementation detail that all callers had to deal
with. Just get rid of it.
2020-01-22 11:49:59 -08:00
Jason Nader
a5d625d389 Stringify j.fish 2020-01-22 17:43:18 +01:00
Jason Nader
2323a5629c Stringify netctl completions 2020-01-22 17:41:43 +01:00
Jason Nader
1cafc4eff6 Amend comments incorrectly referring to sed 2020-01-22 17:40:31 +01:00
Aaron Bieber
0918b537ac Get the list of VMs in a less fragile way. 2020-01-22 16:48:02 +01:00
Fabian Homborg
d61c188c3c Fix xdg mimetype completion
This hung when no file existed, and failed to properly find the
directories if they didn't end in a "/".

Fixes #6525

[good for 3.1.0]
2020-01-22 16:33:56 +01:00
ridiculousfish
e398f66772 Run clang-format 2020-01-21 14:43:17 -08:00
Jason Nader
6fb545cf9b Stringify gpg completions 2020-01-21 17:57:57 +01:00
Jason Nader
13a26a1c65 Remove dropbox completions 2020-01-21 16:57:27 +01:00
Jason Nader
103a26ffb1 Fix function output on FreeBSD/Cygwin systems 2020-01-21 16:55:37 +01:00
Fabian Homborg
4e931fd967 completions/kill: Offer -SIGNAME
E.g. "kill -HUP".
2020-01-20 17:51:59 +01:00
Fabian Homborg
1480865d52 Stringify make_completion_signals 2020-01-20 17:51:59 +01:00
Fabian Homborg
acefa61e8b Hardcode signal names/numbers on cygwin
Work around weirdness in Cygwin's kill implementation.

Fixes #6469.
2020-01-20 17:51:59 +01:00
David Adam
26f744037a Revert "Remove Base16 mention from CHANGELOG"
Will be in 3.1.0.
2020-01-20 20:13:59 +08:00
Shun Sakai
2035b90bfe CHANGELOG: Add keepassxc-cli completions 2020-01-20 20:13:54 +08:00
Jason Nader
f63ae0fb4d Add missing comment to bower.fish
Same comment found in yarn.fish
2020-01-20 19:45:21 +08:00
Fabian Homborg
0e5846ee38 completions/fish: Rename debug-level
This was renamed to just "--debug", but missed in the completions.

See #5910

[ci skip]
2020-01-19 13:28:21 +01:00
Fabian Homborg
d972623191 Fix vendor paths without $XDG_DATA_DIRS
We'd use $__fish_data_dir, but that already had the "/fish" component,
and then we'd add it again later, so we would try to find vendor
functions in places like

/usr/share/fish/fish/vendor_functions.d

which obviously don't exist.

Instead let's add the "/fish" component to the xdg dirs early, which
also saves us from having to repeat it later.

Fixes #6428
See #6508

[ci skip]
2020-01-19 09:28:56 +01:00
Shun Sakai
f04536637d Add keepassxc-cli completions 2020-01-18 12:27:04 -08:00
ridiculousfish
e34e5d88db Remove Base16 mention from CHANGELOG
It's not in 3.1.0.
2020-01-18 12:26:25 -08:00
Greg Anders
e143618aef Set base16 colors for operator, escape, and match 2020-01-18 12:16:19 -08:00
Greg Anders
1331b32cce Add Base16 color options to fish_config 2020-01-18 12:16:19 -08:00
ridiculousfish
c14d54032f Add a cant_wait parameter to iothread_perform
Sometimes we must spawn a new thread, to avoid the risk of deadlock.
Ensure we always spawn a thread in those cases. In particular this
includes the fillthread.
2020-01-18 11:51:13 -08:00
ridiculousfish
d38db1bc61 Add a test for deep command substitutions 2020-01-18 11:50:50 -08:00
Johannes Altmanninger
b18f605e4f Fix completions if previous arg is a variable
complete -C'echo $HOM ' would complete $HOM instead of a new token.
Fixes another regression introduced in
6fb7f9b6b - Fix completion for builtins with subcommands
2020-01-18 20:21:10 +01:00
Fabian Homborg
1643df0d23 Docs: Clean up set_color
The wording should now be a bit nicer.

[ci skip]
2020-01-18 18:45:53 +01:00
Fabian Homborg
14fd4570d5 Test using more than 64 threads
See #6503
2020-01-18 10:43:59 +01:00
Fabian Homborg
018e51c935 Just hardcode a thread limit of 1024
64 is too low (it's actually reachable), and every sensible system should have a limit above
this.

On OpenBSD and FreeBSD it's ULONG_MAX, on my linux system it's 61990.

Plus we currently fail by hanging if our limit is reached, so this
should improve things regardless.

On my linux system _POSIX_THREAD_THREADS_MAX works out to 64 here,
which is just too low, even tho the system can handle more.

Fixes #6503 harder.
2020-01-18 10:30:32 +01:00
Fabian Homborg
ca08cc331b Use PTHREAD_THREADS_MAX if available
Stops us deadlocking on OpenBSD if we need more than 4 threads.

Fixes #6503
2020-01-18 09:07:31 +01:00
Johannes Altmanninger
b62fa53807 set error code on failed command substitution to 255 instead of -1
the exit status ought to be in 0-255, e.g. exit -1
2020-01-17 17:36:18 +01:00
Johannes Altmanninger
4170e8cff2 typo 2020-01-17 17:27:23 +01:00
Johannes Altmanninger
05ddda9155 use variable assignments on commandline in completions
Fixes #6507

To do: If a variable assignment uses a command substitution that errors,
the error is printed, but without a proper location.
2020-01-17 14:53:35 +01:00
Johannes Altmanninger
c513724d7b Do not store reference to a temporary
Seems to have worked by accident. I could swear that I had fixed this..
2020-01-17 14:49:52 +01:00
ridiculousfish
1da09f2c52 Ensure new job IDs are never smaller than existing running jobs
This makes job IDs "monotone" in the sense that newly spawned jobs
always have larger IDs than existing jobs, as requested in #6053
2020-01-16 16:01:29 -08:00
ridiculousfish
1978ac87a1 Remove reader_test_should_cancel
Use cancel_checker more pervasively.
2020-01-16 15:21:45 -08:00
ridiculousfish
0f7bba5f0e Introduce operation_context_t
This commit recognizes an existing pattern: many operations need some
combination of a set of variables, a way to detect cancellation, and
sometimes a parser. For example, tab completion needs a parser to execute
custom completions, the variable set, should cancel on SIGINT. Background
autosuggestions don't need a parser, but they do need the variables and
should cancel if the user types something new. Etc.

This introduces a new triple operation_context_t that wraps these concepts
up. This simplifies many method signatures and argument passing.
2020-01-16 15:21:28 -08:00
ridiculousfish
db98ee13a9 Make complete() return the completion list directly
Returning it through a pointer was a remnant of pre C++-11 days.
2020-01-16 15:18:50 -08:00
ridiculousfish
4bb18eaf42 Use completion_list_t naming everywhere
std::vector<completion_t> -> completion_list_t
2020-01-16 15:18:49 -08:00
ridiculousfish
98e714f98f clang-format .cpp and .h files 2020-01-16 15:18:28 -08:00
ridiculousfish
6705a2efc6 Migrate a bunch of code out of common.h
Put it into wcstringutil, path, or a new file null_terminated_array.
2020-01-15 13:16:43 -08:00
ridiculousfish
273afca3da Remove some dead code 2020-01-15 11:59:40 -08:00
ridiculousfish
4f01eef88d Default some ivars in wildcard_expander_t 2020-01-15 11:43:10 -08:00
ridiculousfish
5f130c2d6d Give wildcard_expand_result_t a real return value
Use an enum instead of an int.
2020-01-15 11:11:43 -08:00
David Adam
607b40f4c6 CHANGELOG: further work on 3.1.0
[ci skip]
2020-01-16 00:32:59 +08:00
ridiculousfish
7e1270ae70 Be more disciplined about cancellation signals
Rather than storing a "should cancel" flag in the parser, store the
actual signal which triggered cancellation.
2020-01-14 15:20:04 -08:00
Shun Sakai
a7442207c2 CHANGELOG: add hwinfo and chronyc completions 2020-01-14 17:17:28 +01:00
Shun Sakai
8c725c7d54 Add chronyc completions 2020-01-14 17:17:28 +01:00
Shun Sakai
316bb88ee7 Add hwinfo completions 2020-01-14 17:17:28 +01:00
ridiculousfish
47b87dbeb7 Factor internal process short-circuiting together
When executing a buffered block or builtin, the usual approach is to
execute, collect output in a string, and then output that string to
stdout or whatever the redirections say. Similarly for stderr.

If we get no output, then we can elide the outputting which means
skipping the background thread. In this case we just mark the process as
finished immediately.

We do this in multiple locations which is confusing. Factor them all
together into a new function run_internal_process_or_short_circuit.
2020-01-13 14:46:31 -08:00
ridiculousfish
fe4f7fea5c run_internal_process can no longer fail, remove its bool return 2020-01-13 14:40:24 -08:00
ridiculousfish
1efa641105 Move some fflushes around in handle_builtin_output 2020-01-13 14:35:20 -08:00
ridiculousfish
7b25787e52 Mild refactoring of exec_block_or_func_process
Reduce some code duplication.
2020-01-13 14:28:28 -08:00
ridiculousfish
399062c219 Rationalize a bit of how failed exec() works
We don't need to mark the job as completed in this case, because the
caller will remove the job.
2020-01-13 14:18:43 -08:00
ridiculousfish
8d598dcffc Use handle_child_status when reaping internal procs
This reduces the number of distinct locations where we mark a process as
completed.
2020-01-13 14:12:05 -08:00
Fabian Homborg
69b464bc37 Run fish_indent on all our fish scripts
It's now good enough to do so.

We don't allow grid-alignment:

```fish
complete -c foo -s b -l barnanana -a '(something)'
complete -c foo -s z              -a '(something)'
```

becomes

```fish
complete -c foo -s b -l barnanana -a '(something)'
complete -c foo -s z -a '(something)'
```

It's just more trouble than it is worth.

The one part I'd change:

We align and/or'd parts of an if-condition with the in-block code:

```fish
if true
   and false
    dosomething
end
```

becomes

```fish
if true
    and false
    dosomething
end
```

but it's not used terribly much and if we ever fix it we can just
reindent.
2020-01-13 20:34:22 +01:00
Fabian Homborg
31e6ae0099 Ignore EPERM for setpgid
In case we are a session leader, we get a harmless EPERM, yet we used
to quit. Stop doing that.

Fixes #6499.
2020-01-13 18:57:19 +01:00
Fabian Homborg
759d5a1fb3 Fix uvar error message
This used a wstring format when it was a narrow string.
2020-01-13 17:48:09 +01:00
239
56f52bc693 Add completions for cryptsetup (#6488) 2020-01-13 10:47:52 +01:00
Johannes Altmanninger
0c92c7d8ac Fix remote path escaping for rsync and scp completions
They need to be escaped twice, for the local and the remote shell.
Also don't suggest local files as rsync remote paths (-a -> -xa) and
fix completion for remote paths containing multiple consecutive spaces.

Fixes #1872
[ci skip]
2020-01-13 10:30:57 +01:00
Johannes Altmanninger
e3782603ec Load vendor configuration from $XDG_DATA_DIRS/vendor_*.d
$XDG_DATA_DIRS/vendor_{completions,conf,functions}.d
Additionally, CMake variables extra_{completions,conf,functions}dir are
appended, if they are not already contained in $XDG_DATA_DIRS.

If XDG_DATA_DIRS is not defined, we fall back to

$__fish_datadir/vendor_completions.d:${extra_completionsdir}

for completions. Same for conf and functions.
2020-01-12 16:12:41 +01:00
David Adam
577dd1ccf1 CHANGELOG: work on 3.1.0
Updates to f136d634eb
2020-01-12 22:39:26 +08:00
239
0acaf766a2 Update Keybase completions (#6479)
* Update Keybase completions

* Apply suggested change for filtering options
2020-01-10 17:12:12 +01:00
Frederik Gladhorn
19a320caa8 Clarify how to redirect stderr into stdout in tutorial 2020-01-09 18:39:20 +01:00
Fabian Homborg
eb7172458b Add .desktop file and logo for appimage
The logo is actually extracted from the site, but since it's just for
the appimage (I don't even know where it shows it, tbh) it's okay for
now.

Progress towards #6475.

[ci skip]
2020-01-08 19:50:46 +01:00
Johannes Altmanninger
9a355d5482 complete: replace confusing comment with test case 2020-01-08 17:53:46 +01:00
Johannes Altmanninger
75fa3b6bae unbreak missing argument error on long option 2020-01-08 17:33:36 +01:00
Johannes Altmanninger
fdf398e435 show missing argument error only for last flag
closes #6483
2020-01-08 14:59:26 +01:00
Johannes Altmanninger
0e707b88f0 argparse: fix error message for missing option argument
case #1 in #6483
2020-01-08 14:38:05 +01:00
Johannes Altmanninger
d8e93a5956 fix sphinx warning
[ci skip]
2020-01-08 09:38:54 +01:00
Johannes Altmanninger
992c864f26 Don't overwrite unrelated variables with for-loop-variables
for-loops that were not inside a function could overwrite global
and universal variables with the loop variable.  Avoid this by making
for-loop-variables local variables in their enclosing scope.

This means that if someone does:

    set a global
    for a in local; end
    echo $a

The local $a will shadow the global one (but not be visible in child
scopes). Which is surprising, but less dangerous than the previous
behavior.

The detection whether the loop is running inside a function was failing
inside command substitutions. Remove this special handling of functions
alltogether, it's not needed anymore.

Fixes #6480
2020-01-08 09:10:14 +01:00
ridiculousfish
e0cdea9bb6 Correct the usleep calculation in fish_test_helper
'fish_test_helper print_pid_then_sleep' tried to sleep for .5 seconds,
but instead it divided by .5 so it actually slept for 2 seconds.

This exceeds the maximum value on NetBSD so it wasn't sleeping at all
there.

Fixes #6476
2020-01-07 17:07:51 -08:00
Norio Nomura
cc7618985a Don't override exit status when stderr is closed by 2>&-
fixes #6470
2020-01-07 19:57:35 +01:00
Fabian Homborg
b7a0031174 docs/faq: Some minor extensions
[ci skip]
2020-01-06 21:48:35 +01:00
Fabian Homborg
f637b81fb6 sample_prompts/acidhub: Use prompt_pwd
This removes a call to `sed` and allows the user to specify shortening
via the variable.

We still default to disabling shortening because this prompt never
did.

[ci skip]
2020-01-06 18:41:50 +01:00
Guilhem Saurel
9910ee26cd disable virtualenv prompt update in nim prompt
As this information is already wrapped into a _nim_prompt_wrapper
2020-01-06 17:06:24 +01:00
Fabian Homborg
4bfc7318e9 docs/time: Add a note about time command
[ci skip]
2020-01-05 22:28:39 +01:00
Fabian Homborg
484e590b7b Readd unconst cast to tparm calls
Removed in 0dfa7421f3, breaks build with NetBSD curses.
2020-01-05 22:28:39 +01:00
ridiculousfish
f1ce967dfa Do not allow empty items to be added to history
Empty items are used as sentinels to indicate that we've reached the end of
history, so they should not be added as actual items. Enforce this.

Fixes #6032
2020-01-05 12:47:02 -08:00
Fabian Homborg
24970bb549 checks: Use "sleep" without "s" suffix
FreeBSD's sleep doesn't accept it.
2020-01-05 18:41:56 +01:00
Fabian Homborg
611a6589ea Disable command descriptions on macOS 10.15.X
We just do a cheesy version check and hope it works out.

If this is fixed in 10.15.4, we have to reenable it. If it still isn't
fixed in 10.16, we need to adjust it.

Fixes #6270
2020-01-05 18:35:59 +01:00
Fabian Homborg
0f362b4bb2 Change c{begin,end} to begin,end
Unfortunately old distributions are old.

Fixes build failures on GCC 4.8 (RHEL6/7).
2020-01-05 15:44:05 +01:00
Fabian Homborg
23bf9661b2 Document time
This is a bit barebones, but `time` isn't super complicated to use and
it should explain the basics.

Fixes #6442

[ci skip]
2020-01-05 14:50:54 +01:00
Fabian Homborg
f3dbede2a5 Document variable overrides
[ci skip]
2020-01-05 14:44:48 +01:00
Fabian Homborg
0a379135a4 exec_job: Only call getpgrp() once
This reduces the syscall count for `fish -c exit` from 651 to 566.

We don't attempt to *cache* the pgrp or anything, we just call it once
when we're about to execute the job to see if we are in foreground and
to assign it to the job, instead of once for checking foreground and
once to give it to the job.

Caching it with a simple `static` would get the count down to 480, but
it's possible for fish to have its pgroup changed.
2020-01-05 09:41:06 +01:00
Aaron Gyes
d0b0c9a77e minor pcre2_matcher_t cleanup 2020-01-03 16:17:41 -08:00
Aaron Gyes
5281aca659 builtin_string.cpp: remove effectively dead variable 2020-01-03 16:17:41 -08:00
Mahmoud Al-Qudsi
038084b8bf Optimize generation, filtering, and sort of completions 2020-01-03 17:54:14 -06:00
ridiculousfish
62302ee172 Properly print leading comments and indentation in functions
Store the entire function declaration, not just its job list.
This allows us to extract the body of the function complete with any
leading comments and indents.

Fixes #5285
2020-01-03 14:40:28 -08:00
Johannes Altmanninger
c3374edc59 Reject time with background jobs
This check could probably done earlier in the parser but it works.
2020-01-03 01:07:49 -06:00
Johannes Altmanninger
3de95038b0 Make "time" a job prefix
In particular, this allows `true && time true`, or `true; and time true`,
and both `time not true` as well as `not time true` (like bash).

time is valid only as job _prefix_, so `true | time true` could call
`/bin/time` (same in bash)

See discussion in #6442
2020-01-03 01:07:49 -06:00
Aaron Gyes
c1140bc436 Improve kill completions
Use string split instead of cut - which we'd fork for 2*signal
count times in a loop when tab was first pressed. Noticably faster

If giving a signal num, what works everywhere is -NUM, if giving
a signal name, what works everywhere is -s NAME - don't show -sNUM
or -NAME completions; that only works on GNU and it's redundant
anyhow as we show the signal number in the description field for -s
or the signal name for the -NUM case in the pager.

Sort -sNAME completions by the signal number not alphabetical

Shorten descriptions
2020-01-02 22:53:28 -08:00
David Adam
4ccd33a9d0 debian packaging: slight bump in Debian standards version
No changes required between 3.9.4 and 3.9.7 for fish packages.

[ci skip]
2020-01-02 22:37:36 +08:00
David Adam
5df84c1998 cmake: use correct variable for C++ compiler flags
Broken in 8ca936aea6
2020-01-02 22:08:59 +08:00
ridiculousfish
89880891d0 Revert "fish_tests to set HOME and other variables to temporary dir"
This reverts commit cca57a7a87.

The tests target already sets some variables - backing this out.
2020-01-01 17:24:14 -08:00
ridiculousfish
cca57a7a87 fish_tests to set HOME and other variables to temporary dir
Rather than placing files in the user's home directory, have fish_tests
manipulate HOME to be a temporary directory.
2020-01-01 16:34:56 -08:00
ridiculousfish
65e9f31c7a Use autoclose_fd_t more pervasively in history 2020-01-01 13:49:10 -08:00
ridiculousfish
5aa22adccc Make history_filename return a maybe_t<wcstring>
This function can fail, so rather than forcing clients to check the return
value as empty, allow it to return none().
2020-01-01 12:34:42 -08:00
ridiculousfish
efa9d5dd6a Port cd tests to littlecheck 2019-12-31 14:16:20 -08:00
ridiculousfish
91404f1762 Rename job_ids check to job-ids
Other tests use a dash.
2019-12-31 13:32:04 -08:00
ridiculousfish
9a11c03097 Correct the job_ids test on the Mac
The Mac doesn't provide CPU percentages so the column is omitted, causing
the test to fail. Use a regex to cover both cases.
2019-12-31 13:17:26 -08:00
ridiculousfish
b691d3130e Don't give job IDs to block processes either
Extend the commit 8e17d29e04 to block processes, for example:

    begin ; stuff ; end

or if/while blocks as well.

Note there's an existing optimization where we do not create a job for a
block if it has no redirections.
2019-12-31 13:12:24 -08:00
ridiculousfish
a6e5583b5b Correct reordering of jobs in job_promote
job_promote attempts to bring the most recently "touched" job to the front
of the job list. It did this via:

    std::rotate(begin, job, end)

However this has the effect of pushing job-1 to the end. That is,
promoting '2' in [1, 2, 3] would result in [2, 3, 1].

Correct this by replacing it with:

    std::rotate(begin, job, job+1);

now we get the desired [2, 1, 3].

Also add a test.
2019-12-31 12:41:11 -08:00
Dan Zimmerman
8e17d29e04 Introduce the internal jobs for functions
This PR is aimed at improving how job ids are assigned. In particular,
previous to this commit, a job id would be consumed by functions (and
thus aliases). Since it's usual to use functions as command wrappers
this results in awkward job id assignments.

For example if the user is like me and just made the jump from vim -> neovim
then the user might create the following alias:
```
alias vim=nvim
```
Previous to this commit if the user ran `vim` after setting up this
alias, backgrounded (^Z) and ran `jobs` then the output might be:
```
Job	Group	State	Command
2	60267	stopped	nvim  $argv
```
If the user subsequently opened another vim (nvim) session, backgrounded
and ran jobs then they might see what follows:
```
Job	Group	State	Command
4	70542	stopped	nvim  $argv
2	60267	stopped	nvim  $argv
```
These job ids feel unnatural, especially when transitioning away from
e.g. bash where job ids are sequentially incremented (and aliases/functions
don't consume a job id).

See #6053 for more details.

As @ridiculousfish pointed out in
https://github.com/fish-shell/fish-shell/issues/6053#issuecomment-559899400,
we want to elide a job's job id if it corresponds to a single function in the
foreground. This translates to the following prerequisites:

- A job must correspond to a single process (i.e. the job continuation
    must be empty)
- A job must be in the foreground (i.e. `&` wasn't appended)
- The job's single process must resolve to a function invocation

If all of these conditions are true then we should mark a job as
"internal" and somehow remove it from consideration when any
infrastructure tries to interact with jobs / job ids.

I saw two paths to implement these requirements:

- At the time of job creation calculate whether or not a job is
  "internal" and use a separate list of job ids to track their ids.
  Additionally introduce a new flag denoting that a job is internal so
  that e.g. `jobs` doesn't list internal jobs
  - I started implementing this route but quickly realized I was
    computing the same information that would be computed later on (e.g.
    "is this job a single process" and "is this jobs statement a
    function"). Specifically I was computing data that populate_job_process
    would end up computing later anyway. Additionally this added some
    weird complexities to the job system (after the change there were two
    job id lists AND an additional flag that had to be taken into
    consideration)
- Once a function is about to be executed we release the current jobs
  job id if the prerequisites are satisfied (which at this point have
  been fully computed).
  - I opted for this solution since it seems cleaner. In this
  implementation "releasing a job id" is done by both calling
  `release_job_id` and by marking the internal job_id member variable to
  -1. The former operation allows subsequent child jobs to reuse that
  same job id (so e.g. the situation described in Motivation doesn't
  occur), and the latter ensures that no other job / job id
  infrastructure will interact with these jobs because valid jobs have
  positive job ids. The second operation causes job_id to become
  non-const which leads to the list of code changes outside of `exec.c`
  (i.e. a codemod from `job_t::job_id` -> `job_t::job_id()` and moving the
   old member variable to a non-const private `job_t::job_id_`)

Note: Its very possible I missed something and setting the job id to -1
will break some other infrastructure, please let me know if so!

I tried to run `make/ninja lint`, but a bunch of non-relevant issues
appeared (e.g. `fatal error: 'config.h' file not found`). I did
successfully clang-format (`git clang-format -f`) and run tests, though.
This PR closes #6053.
2019-12-31 10:08:50 -08:00
Fabian Homborg
033a832687 Merge pull request #6447 from neheb/clang2
Several more small clang-tidy cleanups
2019-12-31 18:47:24 +01:00
Fabian Homborg
9f61512e67 CHANGELOG prompt improvements
[ci skip]
2019-12-30 14:07:10 +01:00
Fabian Homborg
4a47e212f8 Color the default prompt host if running via SSH
This is part of our (well, my) quest to spice up the default prompt.

In this case we color the host if $SSH_TTY is set, which is easy to
detect and helps draw attention to the host.

See #6398.
See #6375.
2019-12-30 14:03:36 +01:00
Johannes Altmanninger
0afc5258cf Unify detection of fish version upgrade with $__fish_initialized
This variable holds an integer that resembles the fish version up to
that initializations were performed. It should be incremented whenever
some new initialization is required after upgrading fish.  This should
not change the behavior for existing fish installations, except for a
minor message on installations that upgrade from fish<2.3.0.

[ci skip]
2019-12-30 14:00:22 +01:00
ridiculousfish
c963442999 Collapse io_data switch statements
Now that each io_data knows its source and target fd, we don't need to switch
on its types any more.
2019-12-29 15:51:22 -08:00
ridiculousfish
0af5608ce8 io_data_t to store the source_fd directly
Now that all io_data_ts know their source fd, just store it directly in
the base class. This will simplify some uses of io_data_t.
2019-12-29 15:14:08 -08:00
ridiculousfish
5d55004841 Stop adding close actions in pipe and bufferfills
Now that all pipes are marked CLOEXEC, there is no reason to add explicit
close calls here.
2019-12-29 15:00:12 -08:00
ridiculousfish
d0cefe8b65 Always mark pipes as cloexec
There is never a reason to keep these open in exec.
2019-12-29 14:57:16 -08:00
ridiculousfish
b784a0caa3 dup2_list_t::resolve_chain to stop returning maybe
It can no longer fail.
2019-12-29 14:49:05 -08:00
ridiculousfish
94dcd1cc07 Use the given parser when fetching certain histories 2019-12-29 14:26:46 -08:00
ridiculousfish
9f7972a08b clang-format C++ files 2019-12-29 14:25:42 -08:00
Johannes Altmanninger
3d9c0d3c69 Show the first few history entries in set | grep history
As before, but do so efficiently. See #6290
2019-12-29 17:43:25 +01:00
Fabian Homborg
d0edd984d5 Let pacman-derived tools complete zst as well
Arch is switching to zst as the default compression method
2019-12-28 17:10:23 +01:00
Fabian Homborg
b0e3cc4b5c __fish_complete_suffix: Remove eval
This use of eval is unsafe, not really all that useful and can spew
errors that can't be suppressed. So let's remove it, and in future add
a thing that can do expansions in a safe manner

Fixes #6456.
2019-12-28 17:10:23 +01:00
Fabian Homborg
0866013280 Stop using __fish_complete_suffix with a braced argument
__fish_complete_suffix accepts a first argument containing a
brace-expansion, like

    __fish_complete_suffix '.{c,cpp,py}'

We're gonna be removing the `eval` that does that shortly, so let's
remove all uses in our code.
2019-12-28 17:10:23 +01:00
Rosen Penev
06cb0bbe9a [clang-tidy] Add several references
Found with performance-unnecessary-value-param

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-12-26 21:55:53 -08:00
Rosen Penev
5501953c07 [clang-tidy] Add ending namespace comment
Found with llvm-namespace-comment
2019-12-26 21:37:17 -08:00
Rosen Penev
b1349f44f6 [clang-tidy] Add const to reference
Found with performance-unnecessary-copy-initialization
2019-12-26 21:37:15 -08:00
Rosen Penev
5d1ad8de91 [clang-tidy] Use std::move
Found with modernize-pass-by-value
2019-12-26 21:36:23 -08:00
Rosen Penev
49fbca8a8b [clang-tidy] Remove redundant const in function declarations
Found with readability-avoid-const-params-in-decls
2019-12-26 21:25:12 -08:00
Rosen Penev
856fa0ca42 [clang-tidy] Use override instead of virtual
Found with modernize-use-override
2019-12-26 21:25:12 -08:00
Rosen Penev
f2e7def667 [clang-tidy] Remove const from strings
Found with readability-const-return-type
2019-12-26 21:25:12 -08:00
Rosen Penev
668f73c0d6 [clang-tidy] Fix wrong declaration
Found with readability-inconsistent-declaration-parameter-name
2019-12-26 21:25:12 -08:00
Rosen Penev
9e42b0100a [clang-tidy] Remove redudant .get on smart pointer
Found with readability-redundant-smartptr-get
2019-12-26 21:25:11 -08:00
Rosen Penev
2ecc386121 [clang-tidy] Remove redundant c_str
Found with readability-redundant-string-cstr
2019-12-26 21:25:07 -08:00
Rosen Penev
d1e82b59bb [clang-tidy] Switch from size to empty check
Found with readability-container-size-empty
2019-12-26 20:07:53 -08:00
ridiculousfish
df0681d393 Remove process_generation_count_t
It was unused.
2019-12-26 13:33:14 -08:00
ridiculousfish
126e6a929f Remove the ARRAY_SEP define
It's unused.
2019-12-26 13:17:34 -08:00
Fabian Homborg
0e0d63c0df completions/pipenv: Really force it to print fish completions
"To assume" and such.

It doesn't check $SHELL, so it might have some other automagic that
can fail (probably still because of the login shell, but I have no
idea).

Override the special variable that
click-completion (https://github.com/click-contrib/click-completion)
uses to force it instead.

Really fixes #6454.

[ci skip]
2019-12-25 16:29:10 +01:00
Fabian Homborg
aba5beaeb4 completions/pipenv: Force it to print fish completions
This checks $SHELL to determine which completions to print, and $SHELL
is typically set by your login program.

So if the login shell isn't fish, this will print the wrong
completions.

Fixes #6454

[ci skip]
2019-12-25 16:16:08 +01:00
Fabian Homborg
bd8fd9fd0d docs/bind: Document and
[ci skip]
2019-12-25 10:46:46 +01:00
Fabian Homborg
e986970f4d Remove vi_arg_digit and vi_delete_to
They don't do anything anymore.
2019-12-25 10:44:27 +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
Johannes Altmanninger
9f48fc6285 Fix status when function/block evaluation is cancelled
It looks like the last status already contains the signal that cancelled
execution.

Also make `fish -c something` always return the last exit status of
"something", instead of hardcoded 127 if exited or signalled.

Fixes #6444
2019-12-23 17:38:19 +01:00
David Adam
8ca936aea6 cmake: use C++ extension options when checking features
This matches the CMake default of extensions turned on.
2019-12-23 22:26:57 +08:00
David Adam
4d325dcd7a cmake: tidy up adding C++11 compile flags
Two blocks of code were trying to do the same thing in different ways;
standardise on one, and only add the compile flags if CMake won't do it
itself (policy CMP0067).
2019-12-23 22:26:57 +08:00
David Adam
74ab9e72ac cmake: pass C++ standard compiler options to tests
Enables CMake policy 0067.
2019-12-23 22:26:57 +08:00
Mathieu Duponchelle
15c1b3ed4b Place fish in its own process group when launched with -i
Fixes #5909
2019-12-23 10:32:37 +01:00
ridiculousfish
c19407ab0f Default parser_t::eval()'s block type to top
This is the parameter value at every call site except one. Just make it the
default.
2019-12-22 16:27:03 -08:00
ridiculousfish
0c49dce75d Factor block description part of stack traces into a new function 2019-12-22 16:22:20 -08:00
ridiculousfish
a59f35a378 Make block_type_t an enum class 2019-12-22 15:37:14 -08:00
ridiculousfish
4529e7d183 Reverse the order of the block stack
Previously, the block stack was a true stack. However in most cases, you
want to traverse the stack from the topmost frame down. This is awkward
to do with range-based for loops.

Switch it to pushing new blocks to the front of the block list.
This simplifies some traversals.
2019-12-22 15:07:41 -08:00
ridiculousfish
82baf74785 Attempt to fix the build
Move the CMake changes down in the file after the FIND_PACKAGE calls.
2019-12-22 12:31:14 -08:00
ridiculousfish
87854c81f5 Allow C++ standard to be passed to CHECK_CXX_SOURCE_COMPILES
Work around the issue in CMake where C++ standard doesn't get propagated
to CHECK_CXX_SOURCE_COMPILES. Also correctly check for std::make_unique;
the define was missing from the config.h header.
2019-12-22 12:07:46 -08:00
ridiculousfish
10ac83ae32 lru to use std::map, not std::unordered_map
We depend on pointer stability here and it just seems easier
to think about it with std::map.
2019-12-21 17:09:21 -08:00
Sergei Morozov
624e76ae89 Added the --cleanup option completion for the git commit command 2019-12-21 20:03:54 +01:00
David Adam
45633f4a54 cmake: force C++11 in CHECK_CXX_SOURCE_COMPILES for atomic
GCC 4.8 requires the use of `-std=gnu++11` or similar to enable atomic
features. However, older versions of CMake don't pick up the
project-wide target for C++11 when building the configure check targets.
Although CMake policy 0067 could be set to NEW to enable this, it only
exists on CMake 3.8 and newer, while many of our supported platforms are
on an older version.
2019-12-21 22:00:22 +08:00
Johannes Altmanninger
6dd9e50f82 time: complete external time options only if available 2019-12-21 11:56:06 +01:00
Fabian Homborg
f0df211f4c Solve remaining conflicts sv.po
Sorry!
2019-12-21 11:12:17 +01:00
Jason
126e37ab26 Remove all fuzzy translations (see also #6418) 2019-12-21 10:21:45 +01:00
Jason
28d812f543 Restore last good version of Swedish translations (08ff39c) 2019-12-21 10:21:39 +01:00
Jason
616ff28dea Remove all fuzzy translations 2019-12-21 10:17:12 +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
ridiculousfish
2e7cbaeaba Remove io_file_t::is_dev_null
This is no longer used.
2019-12-20 14:47:54 -08:00
ridiculousfish
97dd5ece26 Remove redirection_is_to_real_file
This was previously required so that, if there was a redirection to a
file, we would fork a process to create the file even if there was no
output. For example `echo -n >/tmp/file.txt` would have to create
file.txt even though it would be empty.

However now we open the file before fork, so we no longer need special
logic around this.
2019-12-20 14:40:57 -08: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
Fabian Homborg
dcf8b0e3aa Add test for time 2019-12-20 17:13:21 +01:00
David Adam
8f2f3b648f cmake: check for 64-bit atomic operations directly
780bac671f did not actually successfully
compile on any platforms, leading to -latomic always being added
(including on platforms it does not exist on).

Work on #5865.
2019-12-20 23:47:46 +08:00
David Adam
780bac671f cmake: add -latomic on platforms that need it for 64-bit atomic operations
Closes #5865.
2019-12-20 23:00:06 +08:00
Johannes Altmanninger
3274dbacf4 Fix autosuggestions for time 2019-12-20 09:21:17 +01:00
Mahmoud Al-Qudsi
664d6fb132 Convert time to a job decorator 2019-12-19 23:02:23 -06:00
Mahmoud Al-Qudsi
ca18d88138 Switch to C++11 chrono's steady_clock for portability reasons
`clock_gettime()` is apparently not readily available on many fairly
recent *nix systems.

Closes #6440
2019-12-19 21:26:46 -06:00
Johannes Altmanninger
feb87bbda8 __fish_man_page: ignore prefixing variable assignments 2019-12-19 23:44:58 +01:00
Johannes Altmanninger
1410f938aa read: discard IFS delimiters before the last token
Do this only when splitting on IFS characters which usually contains
whitespace characters --- read --delimiter is unchanged; it still
consumes no more than one delimiter per variable. This seems better,
because it allows arbitrary delimiters in the last field.

Fixes #6406
2019-12-19 23:44:58 +01:00
ridiculousfish
0531c02ce4 Remove 'user_supplied' flag for io_fd_t
user_supplied was used to distinguish IO redirections which were
explicit, vs those that came about through "transmogrphication." But
transmogrification is no more. Remove the flag.
2019-12-19 14:14:23 -08:00
Fabian Homborg
22b2dbd97d functions/history: X is incompatible with SDMV, not C
"-C" is short for "--case-sensitive", which is entirely okay with "--delete".

The one that isn't okay is "-X", which is short for "--Clear".

Seen on gitter.im
2019-12-19 20:59:17 +01:00
Mahmoud Al-Qudsi
ec11bd4af7 [make] add default all in addition to catch-all % 2019-12-18 22:13:41 -06:00
Mahmoud Al-Qudsi
2a14199421 Replace pseudo all target with catch-all %
This should fix the CI broken in-tree builds.
2019-12-18 22:11:02 -06:00
Mahmoud Al-Qudsi
abc2468c70 Add alternate patch to support in-tree CMake Makefile builds
This patch keeps the existing `make` shims via `GNUmakefile` and
`BSDmakefile` but also resolves the issue reported in #6264 with
CMake-generated `Makefile` overwriting the extant `Makefile` causing the
source directory to become dirty once again.

Closes #6264
2019-12-18 21:35:46 -06:00
Mahmoud Al-Qudsi
aeaf2f93e2 Revert "Remove Makefile(s)"
This reverts commit 326f5586de.

See discussion in #6264.
2019-12-18 21:27:09 -06:00
Rosen Penev
9936362599 common.cpp: Don't always include cxxabi.h
cxxabi.h is not available with LLVM's libcxx
2019-12-18 21:03:51 -06:00
Mahmoud Al-Qudsi
e5e66ac6d7 Merge branch 'time' 2019-12-18 21:00:00 -06:00
Mahmoud Al-Qudsi
103726767c [time] Convince GCC control flow does not reach end of function 2019-12-18 20:53:38 -06:00
Mahmoud Al-Qudsi
704a90deec Rename time unit enum to please gcc 2019-12-18 20:48:02 -06:00
Mahmoud Al-Qudsi
be37656067 Support time -v for detailed time output
This breaks down the usage into fish vs external processes.
2019-12-18 20:28:15 -06:00
Mahmoud Al-Qudsi
1ed5e7e478 Dynamically choose units for time output 2019-12-18 20:27:12 -06:00
Mahmoud Al-Qudsi
5956270015 Add time builtin that understands fish script and external executables
This now works:

```fish
function foo
    for n in (seq 1 100000)
        test $n -eq 42
    end
end

time foo
```
2019-12-18 20:27:08 -06:00
Mahmoud Al-Qudsi
364929e46e Disown first-run python completions generation
Closes #6269.
2019-12-18 14:12:49 -06:00
Jason
48bf3a4907 Delete __fish_sgrep.fish 2019-12-18 13:17:54 -06:00
Mahmoud Al-Qudsi
6dc8a1d3a7 Partially address #6340 (escape files starting with -)
This prefixes files beginning with `-` with a `./` when generating
completions *in fish code*. Standard completions for directory listings
generated by the C++ directory traversal code are not afected by this
patch.

Most fish completions defer to `__fish_complete_suffix` to generate the
file/directory completions, these *will* be corrected.
2019-12-18 13:13:23 -06:00
Mahmoud Al-Qudsi
92401d8ebb Fix unused return result hack to work on macOS/GCC 7.4+
As of GCC 7.4 (at least under macOS 10.10), the previous workaround of
casting a must-use result to `(void)` to avoid warnings about unused
code no longer works.

This workaround is uglier but it quiets these warnings.
2019-12-18 12:43:13 -06:00
Mahmoud Al-Qudsi
60670999ad Fix mismatched wchar_t sign comparison errors on some platforms
The C++ spec (as of C++17/n4713) does not specify the sign of `wchar_t`,
saying only (in section 6.7.1: Fundamental Types)

> Type wchar_t shall have the same size, signedness, and alignment
> requirements (6.6.5) as one of the other integral types, called its
> underlying type.

On most *nix platforms on AMD64 architecture, `wchar_t` is a signed type
and can be compared with `int32_t` without incident, but on at least
some platforms (tested: clang under FreeBSD 12.1 on AARCH64), `wchar_t`
appears to be unsigned leading to sign comparison warnings:

```
../src/widecharwidth/widechar_width.h:512:48: warning: comparison of
integers of different signs: 'const wchar_t' and 'int32_t' (aka 'int')
[-Wsign-compare]

    return where != std::end(arr) && where->lo <= c;
```

This patch forces the use of wchar_t for the range start/end values in
`widechar_range` and the associated comparison values.
2019-12-18 12:32:04 -06:00
Mahmoud Al-Qudsi
d90d4f849c Force symlink creation in realpath tests
If an earlier test was aborted, the symlink would still be present and
the subsequent run will fail to create the symlink as it wasn't forced.
2019-12-18 12:31:24 -06:00
ridiculousfish
e52433d6fe Fix gcc warnings harder 2019-12-17 19:51:00 -08:00
ridiculousfish
7ab373fbbd Fix some gcc warnings 2019-12-17 19:22:43 -08:00
ridiculousfish
311f47d683 Remove an errant fprintf from the tests 2019-12-17 18:26:57 -08:00
ridiculousfish
d4daa28690 Correctly set the exit status in block and function processes
Previously, if the user control-C'd out of a process, we would set a
bogus exit status in the process, but it was difficult to observe this
because we would be cancelling anyways. But set it properly.
2019-12-17 18:19:38 -08:00
ridiculousfish
b3d2cdc0ff Unify parse_execution_result_t and eval_result_t again
Do other cleanup to better express the difference between cancellation
and control flow.
2019-12-17 18:12:49 -08:00
ridiculousfish
b82b111e55 Revert "Unify parse_execution_result_t and eval_result_t"
This reverts commit c011f3a8e9.

There is a bug where cancellation is being reported for normal control
flow, not just for SIGINT.
2019-12-17 17:31:18 -08:00
ridiculousfish
c011f3a8e9 Unify parse_execution_result_t and eval_result_t
These are just the same thing now; make everything eval_result_t.
2019-12-17 16:52:15 -08:00
ridiculousfish
a58286baea Remove parse_execution_skipped
This was unused.
2019-12-17 16:44:42 -08:00
ridiculousfish
ebc262cfba Fix sporadic cancellation test failures
If a Control-C is received during expanding a command substitution, we
may execute the job anyways, because we do not check for cancellation
after the expansion. Ensure that does not happen.

This should fix sporadic test failures in the cancellation unit test.
2019-12-17 16:42:14 -08:00
ridiculousfish
72de8768d9 Remove RUNNING_IN_XCODE checks
This is never set any more.
2019-12-17 16:19:12 -08:00
ridiculousfish
09f8e05b80 Clean up the return type of parser_t::eval
parser_t::eval indicates whether there was a parse error. It can be
easily confused with the status of the execution. Use a real type to
make it more clear.
2019-12-17 16:16:43 -08:00
ridiculousfish
4f3b3f7d61 Rename GIT_DIR to FISH_BASE_DIR in git_version_gen.sh
$GIT_DIR is interpreted by git as an environment variable, pointing at the
.git directory. If git_version_gen.sh is run in an environment with an
exported GIT_DIR, it will re-export GIT_DIR to point at the fish source
directory. This will cause git operations to fail.

This could be reproduced as building fish as part of an interactive rebase
'exec' command. git_version_gen.sh would always fail!
2019-12-16 19:18:56 -08:00
ridiculousfish
8bf9f52461 Always detach new pthreads
There are no longer any calls to pthread_join. Just make all pthreads
detached.
2019-12-16 14:08:46 -08:00
Fabian Homborg
3b2dbb99ec po: s/__fish_git_prompt/fish_git_prompt/g 2019-12-16 19:53:10 +01:00
Johannes Altmanninger
24562a9f49 avoid allocation on lookup of $fish_trace
Looking up a variable by a string literal implicitly constructs a wcstring.
By avoiding that, we get a noticeable reduction of temporary allocations.

$ HOME=. heaptrack ./fish -c true
heaptrack stats:			# baseline
        allocations:            7635
        leaked allocations:     3277
        temporary allocations:  602
heaptrack stats:			# new
        allocations:            7565
        leaked allocations:     3267
        temporary allocations:  530
2019-12-16 16:35:41 +01:00
Johannes Altmanninger
b1144a1fde completion: fix file completion of redirection targets
This fixes a regression introduced in
6fb7f9b6b - Fix completion for builtins with subcommands
2019-12-16 12:45:39 +01:00
David Adam
5911fc94b8 littlecheck: pass close_fds to subprocess.Popen
Closes #6435.

close_fds=True is actually the default in Python 2.7 and 3.2, but not in
ancient (but still in production in Red Hat Enterprise Linux 6) Python
2.6. Enable it there as well.
2019-12-15 21:48:55 +08: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
Collin Styles
012773436e Suggest unique remote branches for git-switch
From the `git-switch` documentation:

If <branch> is not found but there does exist a tracking branch in
exactly one remote (call it <remote>) with a matching name, treat as
equivalent to

   $ git switch -c <branch> --track <remote>/<branch>
2019-12-14 09:50:48 +01:00
Collin Styles
afd8fc3cdf Correctly suggest files for git-restore when --staged is present
Previously we would include all modified, deleted, and unmerged files
regardless of what options are present.
2019-12-14 09:50:48 +01:00
Collin Styles
48bf689358 Add completions for git-cherry-pick sequencer subcommands 2019-12-14 09:50:48 +01:00
Collin Styles
e7c401571b Move unique remote branches up in suggested branches for git-checkout
Currently we suggest `origin/mybranch` before `mybranch` which seems
backwards. Most of the time users will want to check out `mybranch`.
2019-12-14 09:50:48 +01:00
Collin Styles
393c9ccf99 Add missing completions for git-branch 2019-12-14 09:50:48 +01:00
David Adam
d2a7b63149 travis: turn on errors for some more serious compiler warnings
These warnings are upgraded to errors on several Open Build Service
platforms, so Travis should notify us as well.
2019-12-14 10:43:47 +08:00
David Adam
58535408b0 redirection: add a default to redirection_spec_t::oflags switch
Fixes a compiler warning/error.
2019-12-14 10:43:47 +08:00
ridiculousfish
9be77d1f9c Correctly handle "self fd redirections"
This adds a test for the obscure case where an fd is redirected to
itself. This is tricky because the dup2 will not clear the CLO_EXEC bit.
So do it manually; also posix_spawn can't be used in this case.
2019-12-13 16:51:49 -08:00
ridiculousfish
d6c71d77a9 Correctly cloexec file redirections
The IO cleanup left file redirections open in the child. For example,
/bin/cmd < file.txt would redirect stdin but also leave the file open.
Ensure these get closed properly.
2019-12-13 16:16:19 -08:00
ridiculousfish
1f83fb47ce Finish the IO cleanup.
Remove some dead code and add missing dtors.
2019-12-12 17:47:08 -08:00
ridiculousfish
5cd9de1049 Eliminate resolve_file_redirections_to_fds
Now that file redirections store FDs and not paths, this function has
nothing to do and can be removed.
2019-12-12 17:34:44 -08:00
ridiculousfish
33aff87c10 Switch io_file_t to store an fd, not a path
Prior to this fix, a file redirection was turned into an io_file_t. This is
annoying because every place where we want to apply the redirection, we
might fail due to open() failing. Switch to opening the file at the point
we resolve the redirection spec. This will simplify a lot of code.
2019-12-12 17:34:40 -08:00
ridiculousfish
af473d4d0c Introduce redirection_spec_t
Prior to this change, a process after it has been constructed by
parse_execution, but before it is executed, was given a list of
io_data_t redirections. The problem is that redirections have a
sensitive ownership policy because they hold onto fds. This made it
rather hard to reason about fd lifetime.

Change these to redirection_spec_t. This is a textual description
of a redirection after expansion. It does not represent an open file and
so its lifetime is no longer important.

This enables files to be held only on the stack, and are no longer owned
by a process of indeterminate lifetime.
2019-12-12 16:44:24 -08:00
ridiculousfish
be685faeb8 Clean up how pipe fd avoidance works
fish has to ensure that the pipes it creates do not conflict with any
explicit fds named in redirections. Switch this code to using
autoclose_fd_t to make the ownership logic more explicit, and also
introduce fd_set_t to reduce the dependence on io_chain_t.
2019-12-12 14:58:18 -08:00
Dan Martinez
4e52feb51a Have type deal with both flavors of fileless function (#6421)
* Deal with *both* types of dynamic function

* Use a guard (`--`) when `-` is an argument
2019-12-12 20:42:11 +01:00
Dan Martinez
9a3886dc2b Make type -p and type -P behave as documented (#6412)
* Make `type -p` and `type -P` behave as documented

* Recognize `-` as an additional sign of no path

Functions created via `source` (like by `alias`) cause `functions --details` to return `-`
rather than `stdin` when invoked upon them.
2019-12-12 17:09:52 +01:00
239
d23ea5f455 Added completions for Keybase commands 2019-12-12 14:16:21 +01:00
239
f1e4dc7ca8 Fixed completion for zpaq 2019-12-12 14:14:43 +01:00
Johannes Altmanninger
a446085c40 Update nmcli completions
Set variables for available connections and SSIDs only when the completion is loaded.
This is not perfect but faster than scanning for connections everytime.

Don't complete connection UUID, DBUS-PATH, ACTIVE-PATH because they are unintelligible.
Instead only complete the connection name.

See #6379

[ci skip]
2019-12-12 11:53:37 +01:00
Shun Sakai
11d529557a Update nmcli completions 2019-12-12 11:53:37 +01:00
Johannes Altmanninger
d22c7ab993 enhance sudo completions
Flag e/edit does not take an argument, so `sudo -e a` TAB would complete
subcommands.

[ci skip]
2019-12-12 09:08:42 +01:00
ridiculousfish
c0b3be9fb4 Stop storing block_io in job_t
Prior to this fix, a job would hold onto any IO redirections from its
parent. For example:

    begin
        echo a
    end < file.txt

The "echo a" job would hold a reference to the I/O redirection.
The problem is that jobs then extend the life of pipes until the job is
cleaned up. This can prevent pipes from closing, leading to hangs.

Fix this by not storing the block IO; this ensures that jobs do not
prolong the life of pipes.

Fixes #6397
2019-12-11 16:34:20 -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
Jason
0b53e51634 Remove translations for non-existent files/functions 2019-12-11 22:22:58 +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
ridiculousfish
970288c854 Migrate the read limit into parser_t::libdata
It is more natural here than "on the last bufferfill."
2019-12-11 11:50:52 -08:00
Fabian Homborg
ff4498ceec CHANGELOG: Add some nice bits
[ci skip]
2019-12-11 20:50:23 +01:00
Johannes Altmanninger
cc7ae03070 prompt: don't consider SIGPIPE a failure
[ci skip]
2019-12-11 11:32:58 +01:00
Johannes Altmanninger
94b5720343 prompt: remove fallback for $fish_color_host
This was mostly dead, since $fish_color_host is set to normal in
__fish_config_interactive. The assignment was only used if the user
explicitly unsets fish_color_host (which they shouldn't, really).
Anyway it's weird to use cyan, use normal instead.
[ci skip]
2019-12-11 11:32:58 +01:00
Johannes Altmanninger
2f1a5e65d8 prompt: don't set default colors twice
The colors are set in __fish_config_interactive before the prompt is
painted for the first time.

Also initialize the $fish_color_status for the (pipe) status, bump the
version for that.
[ci skip]
2019-12-11 11:32:58 +01:00
Johannes Altmanninger
3f10da0d01 Persist new zero-length universal variables
Because of default initialization to an empty list, code that relies on
set -U __fish_init_3_x was run every time.
2019-12-11 11:32:58 +01:00
ridiculousfish
0b1af1ace4 Correct the use of the constructed pointer in job lineage
This was always being set to a different pointer. Ensure the root job
shares its constructed pointer with its children.
2019-12-10 18:32:56 -08:00
ridiculousfish
1e15aa4c4a Correctly style io_chain_t::print 2019-12-10 17:21:03 -08:00
ridiculousfish
0573e95b03 Resurrect io_print 2019-12-10 17:18:37 -08:00
Johannes Altmanninger
d4a3b30b73 prompt: move status to the right in classic_status sample prompt
This is consistent with the other prompts that include status.

[ci skip]
2019-12-11 01:19:12 +01:00
Johannes Altmanninger
6902459566 prompt: don't print status of last process in pipe twice
If a command fails, print the pipestatus in red instead of yellow and
don't print the status of the last process again. See #6375.

Also use $fish_color_status for coloring status consistently.

Also use __fish_pipestatus_with_signal to print SIGPIPE instead
of a numeric code on e.g.: yes | less +q

[ci skip]
2019-12-11 01:19:12 +01:00
ridiculousfish
eaa87ff885 Correct a comment
A comment claimed that 0 was STDOUT_FILENO. In fact this should be 1.

Also default the fd for pipe_or_redir_t to -1, as 0 is not a sensible
default.
2019-12-10 16:14:34 -08:00
Johannes Altmanninger
6b2addd9f3 prompt: don't print pipestatus if only the last process failed
Example: ps | grep something

[ci skip]
2019-12-10 22:35:24 +01:00
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
15c6d8fd4c completions/zstd: Remove code to figure out number of CPUs
This purported to need python > 3.4, but used anypython.

Plus it's not super useful anyway since it can easily be told to
use *all* cpus, so there's no need to set it to the precise number.

See #6400.

[ci skip]
2019-12-10 20:20:21 +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
Akatsuki
efb72f1f91 Revert "Move __fish_systemd_machines into machinectl completion script"
This reverts commit 9c15b5b7a4.
2019-12-09 21:07:21 +01:00
ridiculousfish
f136d634eb Collapse a job's "parent stuff" into a new type job_lineage_t
Currently a job needs to know three things about its "parents:"

1. Any IO redirections for the block or function containing this job
2. The pgid for the parent job
3. Whether the parent job has been fully constructed (to defer self-disown)

These are all tracked in somewhat separate awkward ways. Collapse them
into a single new type job_lineage_t.
2019-12-08 15:03:07 -08:00
ridiculousfish
e3b8203187 Implement logger_t::log_fmt for narrow chars by trampolining to wide chars
This satifies the glibc.
2019-12-08 14:47:52 -08:00
ridiculousfish
92a16921bf Add a test to verify that processes get the right pgrps in pipelines 2019-12-08 13:45:24 -08:00
ridiculousfish
d47541a3d7 Add a tricky test to verify disowning an in-flight job
There's some logic in fish to prevent blowing up when an under-construction
job is disowned. Add a test for it.
2019-12-08 11:44:21 -08:00
ridiculousfish
2ec8cd3bca Remove a dead variable 2019-12-07 11:28:22 -08:00
ridiculousfish
f575c55f5b Migrate the logic to make empty functions succeed into the performer
This is a more natural place for this logic.
2019-12-07 11:06:54 -08:00
ridiculousfish
098fe86ebf Port empty functions test to littlecheck 2019-12-07 11:02:22 -08:00
ridiculousfish
a7f6fd22d4 Factor block and fish function execution into a "performer" std::function
In preparation for concurrent execution, invert the control of function and
block execution. Allow a process to return an std::function that performs the
the execution. This can be run on either the main or a background thread
(eventually).
2019-12-07 10:29:06 -08:00
Fabian Homborg
b2332e9f3e Switch default prompt to Classic+VCS
This has more info, in particular vcs and status.

The old default is still available as the "classic" prompt.

Fixes #6375.
2019-12-07 19:25:41 +01:00
Shun Sakai
b862c63905 Fix an issue that cannot run on non-Linux systems
If Python 3.4 or later installed on the system, complement to the
number of physical cores. In addition, even if the number of physical
cores cannot be obtained, it was fixed to run properly.
2019-12-07 12:21:51 +01:00
Shun Sakai
9510d317c1 CHANGELOG: add lz4 and zstd completions 2019-12-07 12:21:51 +01:00
Shun Sakai
8d56609734 Add zstd completions
Squashed commit of the following:

commit 55c8e73faff2418161404f012440acced09580e4
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 05:25:02 2019 +0900

    Implementation of `zstdless` completions

commit e81ae6f83fb9f23bdd6038fbf29ea594da098c2c
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 05:20:33 2019 +0900

    Implementation of `zstdgrep` completions

commit 2ade3a9c01bdc5b024f785c369fcb6c3e007cb19
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:50:42 2019 +0900

    Implementation of `pzstd` completions

commit 0b9cb86a6936f3de18db7b2c012da6efec89c8e8
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:39:52 2019 +0900

    Implementation of `zstdcat` completions

commit e4a4101d18a82fb06ee451560d079b9b81af5f3e
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:25:05 2019 +0900

    Implementation of `unzstd` completions

commit 88ad0af46d486a92ab3989c55abb3ff477e5a372
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:18:38 2019 +0900

    Implementation of `zstdmt` completions

commit 13f2bf7951501031c61a5c0f143b8a29eaa9437e
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 01:13:52 2019 +0900

    Implementation of `zstd` completions
2019-12-07 12:21:51 +01:00
Shun Sakai
bc2634eaaf Add lz4 completions
Squashed commit of the following:

commit 08ea083bf87a613675789937d7f6740daa26fc61
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Thu Nov 28 23:51:35 2019 +0900

    Implementation of `lz4cat` completions

commit 027adedfeb7bb65ffd46e44b4266df3d98368326
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Thu Nov 28 23:36:12 2019 +0900

    Implementation of `unlz4` completions

commit 522925450a8076d4a0d3377cd9233abc643bbbf7
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Thu Nov 28 23:19:45 2019 +0900

    Implementation of `lz4c` completions

commit 298ce5e05e3be2cac774063ed2ee8289ba53cf24
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Thu Nov 28 23:02:52 2019 +0900

    Implementation of `lz4` completions
2019-12-07 12:21:51 +01:00
Peter Collingbourne
6dc4ac60ae Use $PWD to retrieve the current directory in __fish_move_last.
(command pwd) uses the system's implementation of pwd. At least the GNU
coreutils implementation defaults to -P, which resulted in symlinks being
expanded when switching between directories with nextd/prevd.
2019-12-07 12:20:31 +01:00
Jason
7999cd4f25 Remove fish_fallback_prompt function 2019-12-07 12:16:48 +01:00
Fabian Homborg
9d14594f7c Merge pull request #6390 from ammgws/debian
Move __fish_print_debian_services into invoke-rc.d completion script
2019-12-07 12:16:29 +01:00
Jason
c4400c31f7 Remove deprecated function 2019-12-07 12:16:15 +01:00
Jason
3129b3c5ef Move __fish_print_debian_services into invoke-rc.d completion script 2019-12-05 05:26:26 +09:00
Fabian Homborg
9efb7fd5f6 __fish_cancel_commandline: Always repaint
Fixes #6394.
2019-12-04 21:21:34 +01:00
Fabian Homborg
1fdb23637a Clean up Classic + VCS prompt
- Don't use a guard uvar - we're only setting variables now, and
- that's basically free.
- Allow non-universal color variables
- Simplify the root color setting a bit.
- Some comments

[ci skip]
2019-12-04 21:21:34 +01:00
Jason
a361cde1df Move __fish_complete_svn_diff into the completion script 2019-12-04 20:53:58 +01:00
Jason
965b142acd Move __fish_print_zfs_* into zfs completion script 2019-12-04 20:53:01 +01:00
Jason
69dccce937 Move __fish_print_function_prototypes into valgrind completion script 2019-12-04 20:51:55 +01:00
Jason
013001c283 Move __fish_print_lsblk_columns into lsblk completion script 2019-12-04 20:51:37 +01:00
Jason
5107de395d Move __fish_print_xdg_desktop_file_ids into xdg-mime completion script 2019-12-04 20:51:21 +01:00
Jason
9c15b5b7a4 Move __fish_systemd_machines into machinectl completion script 2019-12-04 20:51:09 +01:00
Jason
b658b421ad Move __fish_ports_dirs into ports completion script 2019-12-04 20:50:55 +01:00
Jason
40832f897c Move __fish_portage_print_repository_names into emaint completion script 2019-12-04 20:50:28 +01:00
Jason
69255d5641 Move __fish_parse_configure into configure completion script 2019-12-04 20:50:19 +01:00
Jason
b3f8a93e02 Move __fish_print_abook_emails into mutt completion script 2019-12-04 20:50:01 +01:00
Michael Jarvis
1be8277f41 Minor tweak to silence warning
Silences a clang++ warning:

"using the result of an assignment as a condition without parentheses"
2019-12-03 19:34:37 -08:00
Jason
dacc0b595c Dont clobber fish_browser if cygstart is available 2019-12-03 18:07:18 +01:00
Johannes Altmanninger
c3374ffd08 Use read --tokenize instead of eval for $BROWSER & $EDITOR 2019-12-03 12:19:16 +01:00
David Adam
d90a62c151 fish.spec: depend on Python on CentOS/RHEL 8 for tests 2019-12-03 15:05:38 +08:00
David Adam
1f6f1b347c fish.spec: use system pcre2 on all platforms except RHEL 6/7 2019-12-03 14:47:52 +08:00
Shun Sakai
62d435f25b Add completions of --committer-date-is-author-date and --ignore-date for git-rebase 2019-12-02 15:23:56 +01:00
Shun Sakai
b4f0a67ef2 Add git-count-objects and git-gc completions 2019-12-02 15:23:56 +01:00
edef
031d30c8ac Handle multiple arguments in $PAGER
$PAGER may contain arguments, and should thus be word-split before 
invocation.
2019-12-02 15:15:33 +01:00
Fabian Homborg
d91b0f86f4 Repaint all prompts if the variables change
This is a good idea in general and simplifies the Classic + VCS
prompt.
2019-12-01 18:15:36 +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
115892ccd2 alias: Use read --tokenize
This did some weird unescaping to try to extract the first word.

So we're now more likely to be *correct*, and the alias benchmark is
about 20% *faster*.

Call it a win-win.
2019-12-01 18:14:26 +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
Jason
2fd1e4ab75 Move __fish_complete_unrar into the completion script 2019-12-01 17:35:35 +01:00
Jason
fa373c102c Move __fish_complete_wvdial_peers into the completion script 2019-12-01 17:34:46 +01:00
Jason
6486349725 Move __fish_complete_tar into the completion script 2019-12-01 17:34:27 +01:00
Jason
6245d76e57 Move __fish_complete_lsusb into the completion script 2019-12-01 17:33:07 +01:00
Jason
b3291619f4 Add missing logic to trampoline block 2019-12-01 17:31:41 +01:00
Jason
b358cee5fe Move __fish_complete_setxkbmap into the completion script 2019-11-30 12:12:18 +01:00
Jason
d1a153cc7e Dont convert path if browser is going to be run in terminal 2019-11-30 09:33:38 +01:00
Jason
585e4e905b Dont convert path if browser is going to be run in terminal 2019-11-30 09:33:38 +01:00
Jason
8192fb2f2a Fix Windows path support for WSL/Cygwin
- Use wslpath under WSL to provide full path to help file
- Use eval on the final command to cmd.exe
- Use trampoline where necessary for Cygwin
2019-11-30 09:33:38 +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
Rosen Penev
6b6884aec6 osx/install: Run through shellcheck
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-30 09:27:50 +01:00
Rosen Penev
72bf267d96 make_pkg: Run through shellcheck
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-30 09:27:50 +01:00
Rosen Penev
9fe7efb82f git_version_gen: Run through shellcheck
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-30 09:27:50 +01:00
ridiculousfish
39e5ffde93 Rename __fish_complete_file_url to __fish_evince_complete_file_url
As the function is now private to evince, use a less generic name.
2019-11-30 00:23:54 -08:00
mk2
c36d802dda Move __fish_complete_file_url to evince.fish 2019-11-30 00:21:47 -08:00
ridiculousfish
fb8e90de28 clang-format .cpp files 2019-11-29 23:57:19 -08:00
Rosen Penev
e4a7e7d4f7 [clang-tidy] Use strcmp family properly
Found with bugprone-suspicious-string-compare

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-29 23:46:51 -08:00
Rosen Penev
e45ae9df49 [clang-tidy] Enclose macro arguments in ()
Found with bugprone-macro-parentheses

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-29 23:46:51 -08:00
Rosen Penev
9507c3a159 [clang-tidy] Don't initialize member functions
Found with readability-redundant-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-29 23:46:51 -08:00
Rosen Penev
6f4a9d527c [clang-tidy] Use C++ using instead of C typedef
Found with modernize-use-using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-29 23:46:51 -08:00
Rosen Penev
7d1cc992e5 [clang-tidy] Simplify boolean expressions
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-29 23:46:51 -08:00
Rosen Penev
4087b2ee15 [clang-tidy] Use bool literals
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-29 23:46:50 -08:00
Rosen Penev
c3fa8c04bf [clang-tidy] Don't empty initialize strings
Found with readability-redundant-string-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-29 23:46:50 -08:00
Rosen Penev
87e24db5ef driver.sh: Run through shellcheck 2019-11-28 20:26:01 +01:00
Rosen Penev
a755bc5cf6 make_tarball.sh: Run through shellcheck 2019-11-28 18:57:38 +01:00
ridiculousfish
b5d0075406 Use iothread pool for background fillthreads
Background fillthreads are used when we want to populate a buffer from an
external command. The most common is command substitution.

Prior to this commit, fish would spin up a fillthread whenever required.
This ended up being quite expensive.

Switch to using the iothread pool instead. This enables reusing the same
thread(s), which prevents needing to spawn new threads. This shows a big
perf win on the alias benchmark (766 -> 378 ms).
2019-11-27 12:03:56 -08:00
ridiculousfish
106af5f56a Migrate some iothread functions into member functions of thread_pool_t
This reintroduces commits 22230a1a0d
and 9d7d70c204, now with the bug fixed.

The problem was when there was one thread waiting in the pool. We enqueue
an item onto the pool and attempt to wake up the thread. But before the
thread runs, we enqueue another item - this second enqueue will see the
thread waiting and attempt to wake it up as well. If the two work items
were dependent (reader/writer) then we would have a deadlock.

The fix is to check if the number of waiting threads is at least as large
as the queue. If the number of enqueued items exceeds the number of waiting
threads, then spawn a new thread always.
2019-11-27 12:03:56 -08:00
Fabian Homborg
83f153eb4c Revert "builtin_printf: Use proper functions"
This reverts commit 1102b83b2d.

wcstold_l is not available on musl and we don't currently have our "own" implementation.

Revert for now until we do.
2019-11-27 18:50:28 +01:00
mk2
439470b048 Move __fish_complete_ant_targets to ant.fish 2019-11-27 16:32:37 +01:00
Fabian Homborg
9a3fb3e265 Use POSIX sh in the benchmark driver
There are reasons to use bash, `hash` is not one of them, as `command
-v` is perfectly capable and in POSIX.

[ci skip]
2019-11-27 16:21:11 +01:00
ridiculousfish
efe6fb3c3b Use hyperfine in the benchmark driver if available 2019-11-26 11:10:04 -08:00
Fabian Homborg
662fb3f3d1 Fix line numbers in functions
This added the function offset *again*, but it's already included in
the line for the current file.

And yes, I have explicitly tested a function file with a function
defined at a later line.

Fixes #6350
2019-11-26 18:12:24 +01:00
Johannes Altmanninger
f36705bb66 Fix error messages for "and" and "or" after pipe
Fixes #6347
2019-11-26 14:03:53 +01:00
Johannes Altmanninger
97969a9363 Restore error messages for bare variable assignment
Since #6287, bare variable assignments do not parse, which broke
the "Unsupported use of '='" error message.

This commit catches parse errors that occur on bare variable assignments.
When a statement node fails to parse, then we check if there is at least one
prefixing variable assignment. If so, we emit the old error message.

See also #6347
2019-11-26 13:59:17 +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
ridiculousfish
305409a025 Fix the vi mode bind test
Note support for the 'replace' mode.
2019-11-25 16:43:54 -08:00
ridiculousfish
d11a5088c5 Relnote vi replace mode #6342 2019-11-25 16:42:18 -08:00
0x005c
48dc9b1e82 Add replace mode in vi-mode 2019-11-25 16:05:10 -08:00
ridiculousfish
267b8da935 Remove dead function reconstruct_orig_str
This function is no longer called.
2019-11-25 15:52:30 -08:00
Rosen Penev
1102b83b2d builtin_printf: Use proper functions
Removes unnecessary type conversions.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-25 14:50:40 -08:00
Rosen Penev
69d0bb7c0d io.h: Add missing override
Found with clang's -Winconsistent-missing-destructor-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-25 14:50:40 -08:00
Rosen Penev
586ac3dfa7 [clang-tidy] Convert loops to range based
Found with modernize-loop-convert

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-25 14:50:40 -08:00
Rosen Penev
1055ff321c [clang-tidy] Replace NULL with nullptr
Found with modernize-use-nullptr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-25 14:23:03 -08:00
Rosen Penev
8d54e928cd [clang-tidy] C to C++ headers
Found with modernize-deprecated-headers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-25 14:17:49 -08:00
Rosen Penev
0dfa7421f3 [clang-tidy] Convert C casts to C++ ones
Found with google-readability-casting

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-25 14:17:49 -08:00
Rosen Penev
7f62e30731 [clang-tidy] Replace size comparisons with empty
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-25 14:13:33 -08:00
Rosen Penev
5ca80a61e3 [clang-tidy] Fix inconsistent declarations
Found with readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-25 14:13:33 -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
Jason
3cf6ebc0e1 Amend typos and grammar errors 2019-11-25 13:07:15 +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
Rosen Penev
3b0f642de9 builtin-math: Use normal C trunc
uClibc-ng does not expose C++11 math
functions to the std namespace, breaking
compilation. This is fine as the argument
type is double.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-24 22:02:33 +01:00
ridiculousfish
80a4898e75 Revert "Migrate some iothread functions into member functions of thread_pool_t"
This reverts commit 22230a1a0d.
Also 9d7d70c204

There's some subtle bug here, needs to be tracked down and tested.
2019-11-23 23:35:34 -08:00
ridiculousfish
9023c2187f Make shutdown_fillthread_ a relaxed_atomic_bool_t
Reduces the noisiness of working with it.
2019-11-23 14:12:34 -08:00
ridiculousfish
22230a1a0d Migrate some iothread functions into member functions of thread_pool_t 2019-11-23 14:05:26 -08:00
ridiculousfish
9d7d70c204 Clean up some iothreads
Improve the iothread behavior by enabling an iothread to stick around for
a while waiting for work. This reduces the amount of iothread churn, which
is useful on platforms where threads are expensive.

Also do other modernization like clean up the locking discipline and use
FLOG.
2019-11-23 13:44:27 -08:00
ridiculousfish
a74fc7ef6d Remove the wait_for_threads_to_die parameter to execute_fork
This is always set to false so we can get rid of it.
2019-11-23 12:36:44 -08:00
ridiculousfish
3fb9159b09 Rename spawn_request_t to work_request_t and clean up the API a bit 2019-11-23 12:13:30 -08:00
ridiculousfish
03a289c9ef Add an aliases benchmark 2019-11-23 11:53:49 -08:00
Ray Hogenson
98a98b1424 Change vi selection mode to be inclusive
The current cursor position should be included in the selection to be
consistent with the behavior of vi.

Fixes #5770
2019-11-19 20:25:10 +01:00
Akatsuki
cb72a33e0c Fix some issues in __fish_complete_subcommand.fish
Fix 'string length: Unknown option': add `--` before $subcommand

Fix count $subcommand always = 1 with `sudo` and `doas`:
give argv as array to __fish_complete_subcommand

[ci skip]
2019-11-17 00:39:06 +01:00
Fabian Homborg
330f1701d7 Restyle
This mostly fixes some wrong indents or replaces some stray tab indents.

I excluded alignment on purpose, because we have a whole bunch of code
that goes like

```fish
complete -c foo -n 'some-condition'        -l someoption
complete -c foo -n 'some-longer-condition' -l someotheroption
```

and changing it seems like a larger thing and would include more
thrashing.

See #3622.
2019-11-16 14:57:59 +01:00
Fabian Homborg
aae111584d Disable localized number test on OpenBSD
This feature simply does not work there.
2019-11-16 12:11:09 +01:00
Fabian Homborg
c14a7cbc8f seq.fish: Allow "--" separator
This ended up breaking the random test on OpenBSD (apparently the only
place where this is actually used).
2019-11-16 11:21:45 +01:00
ridiculousfish
64ce1088fd Make function_prepare_environment take argv instead of the process
This will help concurrent execution.
2019-11-14 17:58:39 -08:00
Fabian Homborg
7527fc265b psub: Use explicit command
This would have prevented #6323.

While we don't want to pepper `command` everywhere, `psub` is kind of
a core thing, so we should try to proof it against common problems.
2019-11-14 17:13:39 +01:00
ridiculousfish
e18fd3cddb Allow unclosed subshells in interactive mode
If the user has an unclosed subshell in interactive mode, break the
line instead of producing an error.

Fixes #6316
2019-11-13 18:01:47 -08:00
Ankush Patil
ee982c4f6c Fixes #6280 : Added right associativity to 'pow' function 2019-11-13 13:51:01 -08:00
Sergei Morozov
91bda38d57 Added the missing argument for -c|--configuration option of PHPUnit 2019-11-13 13:24:41 -08:00
Sergei Morozov
9251601e0b Added completion of the argument for the composer show command 2019-11-13 13:23:55 -08:00
Sam Yu
4de9a3e102 Update zypper completion
- fix repo completion
- add completion for locale management
2019-11-13 13:20:38 -08:00
ridiculousfish
2c81229ee6 Remove CMake's NDEBUG definition from release builds 2019-11-13 13:13:08 -08:00
Robin Linden
34e06c4440 Remove overrides of default CMake flags
CMake sets these flags to sane defaults depending on which compiler
you're using, so overriding them isn't very nice.

For example:

with g++, I get
-- Debug: -g
-- RelWithDebInfo: -O2 -g -DNDEBUG
-- MinSizeRel: -O2 -g -DNDEBUG
-- Release: -O3 -DNDEBUG

and with MSVC you get something like
-- Debug: /MDd /Zi /Ob0 /Od /RTC1
-- RelWithDebInfo: /MD /Zi /O2 /Ob1 /DNDEBUG
-- MinSizeRel: /MD /Zi /O2 /Ob1 /DNDEBUG
-- Release: /MD /O2 /Ob2 /DNDEBUG
2019-11-13 13:02:05 -08:00
ideal
8aaccf1587 Reduce times of move and copy operation 2019-11-12 14:58:22 -08:00
Johannes Altmanninger
e37bb0721d completions/git: fix typo in deleted-staged files
Fixes #6315
2019-11-12 21:40:13 +01:00
ridiculousfish
ec08a50769 Eliminate function_data_t
This struct is now mostly useless and can go.
2019-11-12 11:25:41 -08:00
ridiculousfish
6d7a66592b Make function_add take the filename directly instead of a parser 2019-11-12 10:00:42 -08:00
ridiculousfish
b51edcfcac Simplify function_info_t and function_data_t
Work towards cleaning up function definition. Migrate inherit_vars into
props and capture their values at the point of definition.
2019-11-12 09:53:10 -08:00
ridiculousfish
b0cf94e3ba Refactor function_prepare_environment
Migrate it into exec.cpp to reduce the complexity of
exec_block_or_func_process.
2019-11-10 14:46:21 -08:00
ridiculousfish
ac2eed2ffa Make io_chain_t store const io_data_t
This will make it easier to reason about with concurrent execution.
2019-11-10 14:00:30 -08:00
ridiculousfish
521d0e84f5 Remove non-const get_io_for_fd
These could be made unused.
2019-11-10 13:41:12 -08:00
ridiculousfish
424c56006d Add a paranoid assert to io_chain_t::append 2019-11-10 13:31:47 -08:00
ridiculousfish
f2093aef43 Remove io_chain_t::push_front
It was unused.
2019-11-10 13:25:55 -08:00
ridiculousfish
87f4f33600 Remove vars parameter from function_exists_no_autoload
This variable was unused.
2019-11-10 13:13:56 -08:00
Z. Grace Moreau
012a3137df update CHANGELOG 2019-11-10 22:19:15 +01:00
Z. Grace Moreau
35bc811310 add completions for plutil 2019-11-10 22:19:15 +01:00
Sam Yu
ffb4f7a4ff Update zypper completion
- update options to the newest version
- re-format and align
2019-11-10 22:17:00 +01:00
ridiculousfish
2555ecf757 Remove the forbidden function stack
Detect forbidden functions directly from the associated block_t.
Also unify where we do stack overflow detection.
2019-11-10 12:36:46 -08:00
ridiculousfish
626237c9c3 Add a check for fish function stack overflow 2019-11-10 12:35:58 -08:00
ridiculousfish
7bd134f795 Reformat all .cpp files 2019-11-09 16:07:33 -08:00
Clément Martinez
82227b8854 Add apt install --reinstall completion 2019-11-09 22:40:20 +08:00
ridiculousfish
896ef65f8c Rename error_offset to error_offset_within_token
Hopefully clarify the role of this variable.
2019-11-08 16:56:50 -08:00
ridiculousfish
ef8b5e4fa0 Correct certain tokenizer error reporting for unclosed subshells
There was some confusion about the different pointers and offsets
in tokenizer_t::call_error.

Fixes #6281
2019-11-08 16:56:43 -08:00
ridiculousfish
eb2386f3e3 Rename tokenizer_t::buff to token_cursor
That should clarify its role vis-a-vis 'start'.
2019-11-08 16:56:18 -08:00
David Adam
41c42c86e3 travis: remove superfluous CXXFLAGS
Discussion in #6296.
2019-11-09 07:43:51 +08:00
Johannes Altmanninger
270fd14b00 Fix typo
[ci skip]
2019-11-08 11:40:03 +01:00
Johannes Altmanninger
0e4a75c0b5 Do not print greeting with empty $fish_greeting and --private
Fixes #6299

[ci skip]
2019-11-08 11:09:33 +01:00
Johannes Altmanninger
5c3e43bc0c vi mode: make return key in replace mode insert a newline
Fixes #6298

[ci skip]
2019-11-08 10:51:58 +01:00
ridiculousfish
7f59a7e7cf Only dispatch variable changes for the principal variable stack or globals
fish will react to certain variable modifications, such as "TZ." Only do
this if the main stack is modified. This has no effect now because there
is always a single stack, but will become important when concurrent
execution is supported.
2019-11-07 23:15:35 -08:00
ridiculousfish
8f3d745e60 Teach env_stack_impl_t to report whether it modifies a global
This will help in limiting variable dispatch changes to global and
principal modifications.
2019-11-07 23:15:35 -08:00
Johannes Altmanninger
d242ff1808 Add description for automatic fish_update_completions job
See #6269
2019-11-07 23:33:35 +01:00
Johannes Altmanninger
e94b9ccf3e Do import bash history commands containing && or || 2019-11-07 23:33:35 +01:00
Johannes Altmanninger
1cfa3fa819 Speed up import of bash history
Fixes #6295
2019-11-07 23:33:35 +01:00
Collin Styles
422e2dcbdd Add completions for rustup doc
[As of rustup 1.20][1], users can give a topic as an argument to `rustup
doc` to open the relevant documentation page in a browser. This commit
adds completions for these topics to assist users in finding what
they're looking for.

[1]: https://blog.rust-lang.org/2019/10/15/Rustup-1.20.0.html#improvements-to-rustup-doc
2019-11-07 18:48:19 +01:00
Johannes Altmanninger
35115d3d54 __fish_print_help: do not read $LESS 2019-11-07 17:45:54 +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
Fabian Homborg
6050ccbb02 Merge pull request #6294 from ChristopherRogers/patch-1
Fix typo in git clean completion
2019-11-07 07:53:15 +01:00
Christopher Rogers
b089a579bd Fix typo in git clean completion 2019-11-07 15:32:43 +09:00
Jakub Darul
3b4234a9de added d0 to vi keybindings 2019-11-06 18:18:43 +01:00
James Stidard
16bf98f928 Fix: equality vs identity
Changes identity `is` for equality `==` check. To remove python warnings when updating auto complete

```
/usr/local/Cellar/fish/3.0.2/share/fish/tools/deroff.py:770: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(comps) is 2:
/usr/local/Cellar/fish/3.0.2/share/fish/tools/deroff.py:954: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if len(comps) is 2:
Parsing man pages and writing completions to /Users/james/.local/share/fish/generated_completions/
  6155 / 6155 : zic.8
```
2019-11-06 14:13:21 +08:00
Johannes Altmanninger
939d4674e4 Do not compute $history in builtin set.
Most uses of set don't care about the value of $history, and it
can be expensive to compute.

See #6290
2019-11-05 16:53:06 +01:00
David Adam
e1e82ecd40 CHANGELOG: work towards 3.1.0
Up-to-date to eac9ec90.

[ci skip]
2019-11-05 21:50:05 +08:00
Johannes Altmanninger
04c912e0e3 Fix typo, closes #6289
[ci skip]
2019-11-05 13:32:41 +01:00
Johannes Altmanninger
23eb6e9c09 Don't compute $history for variable completion description
Fixes #6288
2019-11-05 13:06:52 +01:00
Johannes Altmanninger
4f1fa9513c Make most subcommand completions take external commands only
Also fix ssh completions which were broken by
277fca9c6a.
2019-11-05 11:47:05 +01:00
David Adam
d8b305d6e4 README.md: add dependency on tee
Required for psub to work correctly.

[ci skip]
2019-11-05 18:06:20 +08:00
Johannes Altmanninger
277fca9c6a Complete all available commands on empty commandline 2019-11-05 09:50:37 +01:00
Johannes Altmanninger
4c73382231 Fix function definitions potentially leaking as completions 2019-11-05 09:50:37 +01:00
Johannes Altmanninger
36693e4391 Complete empty subcomands consistently
If the command is empty, try to complete starting from the empty command
instead of the whole commandline.
2019-11-05 09:05:46 +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
Johannes Altmanninger
afb56a007d Fix completions for env
Fixes #5306
2019-11-05 08:44:04 +01:00
Fabian Homborg
e893c8ca97 Revert "Set fish_clipboard_paste handler once on startup"
This reverts commit f620ddf03b.

Setting the paste handler isn't performance-sensitive.

On the other hand setting it this way makes things less transparent,
less flexible (if e.g. a paste handler is installed while the shell is running),
and causes #6286.

Fixes #6286.

[ci skip]
2019-11-04 20:47:58 +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
Fabian Homborg
d77c465d23 string: Allow -eq again
Instead of forbidding it for both modes, allow it for both and make it
quiet for string.

Fixes #6282
2019-11-04 17:34:37 +01:00
Johannes Altmanninger
6fb7f9b6b8 Fix completion for builtins (with subcommands)
Presently the completion engine ignores builtins that are part of the
fish syntax. This can be a problem when completing a string that was
based on the output of `commandline -p`.  This changes completions to
treat these builtins like any other command.

This also disables generic (filename) completion inside comments and
after strings that do not tokenize.

Additionally, comments are stripped off the output of `commandline -p`.

Fixes #5415
Fixes #2705
2019-11-04 16:44:51 +01:00
David Adam
5f99ec7eae Merge branch 'changelog' of git://github.com/faho/fish-shell into faho-changelog 2019-11-04 22:53:40 +08:00
LawAbidingCactus
19b59fc54e minor fixes to version-specific completions 2019-11-03 21:37:57 +08:00
ridiculousfish
47c0b5f931 Simplify history searching and fix deduplication
The history search logic had a not very useful "fast path" which was also
buggy because it neglected to dedup. Switch the "fast path" to just a
history search type which always matches.

Fixes #6278
2019-11-02 19:33:45 -07:00
ridiculousfish
52e900690b Make history_search_type_t an enum class 2019-11-02 18:56:16 -07:00
ridiculousfish
be35b858c5 Minor allocation reduction in format_history_record
Reuse some storage across calls.
2019-11-02 18:35:19 -07:00
ridiculousfish
72bf5898d3 Clean up how PATH and CDPATH munging occurs
PATH and CDPATH have special behavior around empty elements. Express this
directly in env_stack_t::set rather than via variable dispatch; this is
cleaner.
2019-11-02 16:48:08 -07: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
Z. Grace Moreau
dd1f8489a7 add -o/--old to __fish_seen_argument 2019-11-02 14:48:57 -07:00
Per Bothner
5ece4481a5 Prefer using clr_eos to clear "remaining lines" - but reset color first
This un-reverts pull request #6190, but adds a missing
reset of the color before doing the clr_eos.
2019-11-02 14:34:04 -07:00
ridiculousfish
151e75d141 Autosuggestions to validate the first command, not the last command
When considering an autosuggestion from history, we attempt to validate the
command to ensure that we don't suggest invalid (e.g. path-dependent)
commands. Prior to this fix, we would validate the last command in the
command line (e.g. in `cd /bin && ./stuff` we would validate "./stuff".
This doesn't really make sense; we should be validating the first command
because it has the potential to change the PWD. Switch to validating the
first command.

Also remove some helper functions that became dead through this change.
2019-11-02 13:40:31 -07:00
Johannes Altmanninger
4dbb209421 Docs: escape word characters after backticks
[ci skip]
2019-11-01 19:11:51 +01:00
Johannes Altmanninger
dfc1d1931d Add /usr/local/sbin to PATH for sudo completions
[ci skip]
2019-11-01 17:20:09 +01:00
Johannes Altmanninger
e0d4a1d78b Fix sudo/doas completions not using /sbin
Fixes #6259
[ci skip]
2019-11-01 21:24:03 +08:00
David Adam
713c8f2d32 gpg completions: add further options
Restores work from #6251 wiped out by merge.
2019-11-01 21:16:24 +08:00
David Adam
3365410bde cmake: only define test policy on old versions
CMP0037 only reserves the test name if CTest is included on newer versions of CMake.

This commit fixes a build warning.
2019-11-01 20:58:40 +08:00
Johannes Altmanninger
6702c84d15 Prevent buffer overflow when custom completions edit the commandline
This was introduced in a7ea7648c3
"Completion: maintain cursor position when there is no completion"
2019-11-01 13:21:49 +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
Fabian Homborg
c0d8439f3a math: Print special error for logical operators
Until now, something like

`math '7 = 2'`

would complain about a "missing" operator.

Now we print an error about logical operators not being supported and
point the user towards `test`.

Fixes #6096
2019-11-01 08:43:13 +01:00
0x005c
067b30208d Fix math incorrect parenthesis error on missing term 2019-10-31 22:10:54 +01:00
Fabian Homborg
ab011b0c28 Overhaul CHANGELOG
This reorders many CHANGELOG entries.
The main idea is to keep the "NOTABLE fixes and improvements" for the headline items,
so a bunch of entries (like "Empty uvars can now be exported") are moved to more specific sections.

Other than that, there's some rewording, and the new feature flag is mentioned in Deprecations,
because that's effectively what it is.

[ci skip]
2019-10-31 20:08:32 +01:00
Fabian Homborg
326f5586de Remove Makefile(s)
They were just wrappers around `cmake` and caused cmake with the Makefile generator
to mark in-tree builds as dirty, since it would overwrite them with its own.

Fixes #6264
2019-10-31 19:23:54 +01:00
Fabian Homborg
ec4bbe248e Revert "Prefer using clr_eos to clear "remaining lines""
This reverts commit d502ad2c25.

Fixes #6263
2019-10-31 19:15:03 +01:00
Roman Beranek
c2dbe36e4a scp completions: remove inappropriate opt '-q' from string match -eq cmd 2019-10-31 18:32:28 +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
Fabian Homborg
8acff328e0 svn_prompt: Check for svnversion
MacOS Catalina apparently ships a stripped down svn that doesn't have
`svnversion`, which we use to print the revision.

For now skip the entire step to remove error spam.

Fixes #6267.

[ci skip]
2019-10-30 21:45:50 +01:00
Johannes Altmanninger
20314c5b3d completions/git: improve diff completions
Offer commit ranges only if left of a --.
Suggest added files in git diff --cached (or the --staged synonym)
Fixes #6262
2019-10-30 12:09:38 +01:00
Johannes Altmanninger
deefdaec57 Use the new &| in __fish_paginate 2019-10-29 20:48:10 +01:00
Johannes Altmanninger
f4b4ff63b9 completions/git: honor global git arguments like --git-dir
Fixes #6219
2019-10-29 19:15:35 +01:00
Johannes Altmanninger
4095247deb completions/git: some improvements 2019-10-29 19:13:31 +01:00
Amy Grace
ba56a2ec0e Add completions for irb (#6260) 2019-10-29 19:11:25 +01:00
LawAbidingCactus
21a6a192ae refactor gpg.fish completions
refactor gpg completions into functions
comment changes; improve gpg version detection

[ci skip]
2019-10-29 19:07:35 +01:00
Johannes Altmanninger
5ce4cb66d3 fix stale doc
[ci skip]
2019-10-28 18:36:22 +01:00
Johannes Altmanninger
97d031e20c reformat 2019-10-28 18:36:07 +01:00
Johannes Altmanninger
61486954bc Use a pager to view long outputs of builtin --help
Every builtin or function shipped with fish supports flag -h or --help to
print a slightly condensed version of its manpage.
Some of those help messages are longer than a typical screen;
this commit pipes the help to a pager to make it easier to read.

As in other places in fish we assume that either $PAGER or "less" is a
valid pager and use that.

In three places (error messages for bg, break and continue) the help is
printed to stderr instead of stdout.  To make sure the error message is
visible in the pager, we pass it to builtin_print_help, every call of which
needs to be updated.

Fixes #6227
2019-10-28 18:36:07 +01:00
ridiculousfish
d992480204 Clean up a few string handling bits 2019-10-27 16:22:42 -07:00
Akatsuki
446735af07 completions/btrfs.fish: Format options list
Format the list of completion per command
Easier to read and edit at next time if need
2019-10-27 16:47:48 -07:00
Akatsuki
b43f80e2d9 completions/btrfs.fish: Add detailed options completions
Add completion for options in option groups
Remove myself author information
2019-10-27 16:47:48 -07:00
ridiculousfish
eeac3333df Correctly highlight input following a tokenizer error 2019-10-27 16:08:49 -07:00
ridiculousfish
afd20b8e1a Correctly report the range of tokenizer errors
This enables proper syntax highlighting of tokenizer errors.
2019-10-27 16:05:37 -07:00
ridiculousfish
0bfd897ee0 Add a special error message for |& 2019-10-27 15:24:57 -07: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
Clément Martinez
756e9826bc Improve gpg completions 2019-10-27 13:22:24 -07:00
Mahmoud Al-Qudsi
f620ddf03b Set fish_clipboard_paste handler once on startup
Instead of searching each time.
2019-10-27 12:40:53 -05:00
Mahmoud Al-Qudsi
ae6bdfa37c Handle empty clipboard for all providers
Closes #6254
2019-10-27 12:38:52 -05:00
Johannes Altmanninger
56b4763c67 Fix file completion for builtins "set" and "test -f" and others 2019-10-27 08:07:54 +01:00
Johannes Altmanninger
a930cabb91 Update comment 2019-10-27 06:58:20 +01:00
Johannes Altmanninger
40c553db29 Fix completion scripts for builtins "exec" and "not" 2019-10-27 06:58:20 +01:00
Johannes Altmanninger
9564e4a6d6 Fix formatting in dump_tree 2019-10-27 06:58:20 +01:00
Johannes Altmanninger
4a1edbd3cb make completions for ninja aware of the build directory passed by -C 2019-10-27 06:58:20 +01:00
Jan Tojnar
9d1ccf8110 Fix composer completions on Python 3
Some distros (Arch) use python command for Python 3, so we need to update the scripts to work with it. We cannot just switch to python3 command because MacOS does not ship it.
2019-10-26 18:19:44 +02:00
Akatsuki
b89a6451a3 functions/__fish_print_hostnames: Fix ssh_configs no values return (#6236)
* functions/__fish_print_hostnames: Fix ssh_configs no values return
`string replace` not working with mutlilines variable.
So split per line first.

* functions/__fish_print_hostnames: remove quotes at `split '\n'`
"\n with quotes" will cause `string split` weird issues.

* functions/__fish_print_hostnames: using `read -alz -d \n`
Fix `$contents` issues together
2019-10-26 18:17:52 +02:00
Lior Stern
5b2250883a Add termux support for fish_config. 2019-10-26 18:16:54 +02:00
Akatsuki
0ef6a136e8 completions: add btrfs (#6243)
* completions: add btrfs
Completion definitions for the btrfs-progs.

* completes/btrfs.fish: using `not set -q argv[1]` instead of `test -z $argv`

* CHANGELOG: add btrfs completions
2019-10-26 18:15:42 +02:00
Shun Sakai
3e28ab454f Rename long option of bzip2
From `--bzip` to `--bzip2`
2019-10-26 18:13:54 +02:00
Shun Sakai
7ce38a1ee6 Add supported compression algo to completions for tar
- lzip (--lzip)
- LZMA (--lzma)
- lzop (--lzop)
- Zstandard (--zstd)
2019-10-26 18:13:54 +02:00
Z. Grace Moreau
b6fbec8107 update CHANGELOG 2019-10-26 18:13:15 +02:00
Z. Grace Moreau
4be30a872a add completion for nethack 2019-10-26 18:13:15 +02:00
Gabriel Medeiros Coelho
af48fa5d91 change href attribute to ng-href
Since the url is inside a AngularJS markup {{url}}, it's better to use **ng-href**.

From  [AngularJS Documentation](https://docs.angularjs.org/api/ng/directive/ngHref):
<br>
"Using AngularJS markup like {{hash}} in an href attribute will make the link go to the wrong URL if the user clicks it before AngularJS has a chance to replace the {{hash}} markup with its value. Until AngularJS replaces the markup the link will be broken and will most likely return a 404 error. The ngHref directive solves this problem."
2019-10-26 18:12:44 +02:00
Lior Stern
2810ba0014 Check that /proc/version is readable before reading it in web_config.
/proc/version may be unreadable in Android.
2019-10-26 18:12:10 +02:00
Akatsuki
f8ead077bf completions/pacman.fish: add ignore & ignoregroups completions
`ignore`       -> `$listall`
`ignoregroups` -> `$listgroups`
2019-10-26 18:11:29 +02:00
Akatsuki
0ec954a8c2 completions/pacman.fish: -F add package completions
`-F` add package completions, let `-Fl` work fine
Another changes:
    Add missing quotes, let format neat
2019-10-26 18:11:29 +02:00
Akatsuki
080f367635 completions/pacman.fish: refine completions
Refine completions with pacman 5.2.0 man pages
2019-10-26 18:11:29 +02:00
Akatsuki
d1214edc7a functions/__fish_print_pacman_repos.fish: fix
This function return wrong data.
Fix this.
2019-10-26 18:11:29 +02:00
Akatsuki
2b9dd4595c completes/pacman.fish: replace --force to --overwrite 2019-10-26 18:11:29 +02:00
Akatsuki
4cdc5e4020 completions/pacman.fish: Update for pacman 5.2
pacman 5.2 has remove File Options `-s --search` and `-o --owns`.
Ref: [pacman: rework the UI of -F](https://git.archlinux.org/pacman.git/commit/?id=ff1ae94c102cab487444bcdb0c76ee489c11dfe8)
2019-10-26 18:11:29 +02:00
239
6a9ab0599f completion: zpaq archiver (#6245) 2019-10-25 15:22:09 +02:00
Bruno Heridet
655f7c8c63 doc: add link to echo in printf command
[ci skip]
2019-10-24 21:44:53 +02:00
Johannes Altmanninger
0a5c2051b1 Always use wl-{copy,paste} if running on wayland 2019-10-24 11:42:33 +02:00
David Adam
4fbc6cd3f8 CHANGELOG: minor work on 3.1.0 2019-10-24 17:13:50 +08:00
Johannes Altmanninger
44c311b5df Update changelog 2019-10-24 11:06:19 +02:00
Ryan Adolf
947e46b9cc Add completions for iw 2019-10-24 11:03:54 +02:00
Johannes Altmanninger
785b7d9438 typo 2019-10-24 10:46:02 +02:00
Z. Grace Moreau
8c9f3c7bd4 update CHANGELOG 2019-10-23 19:41:53 +02:00
Z. Grace Moreau
b1fb99b578 add completions for cygpath and cygstart 2019-10-23 19:41:53 +02:00
LawAbidingCactus
305a657694 fix typos 2019-10-23 19:38:44 +02:00
Aaron Gyes
59e4314752 Apply --reverse for fish_color_*'s being used for a background
e.g. Allows using `--reverse` in fish_pager_color_search_match
and actually having the selected pager items display reversed.
2019-10-22 16:28:56 -07:00
Aaron Gyes
5fa9fb52aa config_make.h.in: remove __sentinel
We haven't used this attribute for a while
2019-10-22 16:27:58 -07:00
Fabian Homborg
66938d206a string: Error out on match -eq
The `--entire` would enable output even though the `--quiet` should
have silenced it. These two don't make any sense together so print an
error, because the user could have just left off the `-q`.
2019-10-22 22:11:36 +02:00
David Adam
d579964c7d travis: enable thread sanitizer build 2019-10-20 18:15:00 +08:00
Johannes Altmanninger
b52d3d641e Fix clean build of sphinx-docs 2019-10-20 08:15:58 +02:00
Collin Styles
ffb551fc06 Add --cut-at-cursor option to commandline -op calls in git completions
We used to just check for the presence of "--" on the command line to
make judgements about which completions to suggest. Now, even if "--" is
present, we can still make different suggestions by taking the cursor's
position into account.
2019-10-19 19:28:20 +02:00
Collin Styles
12a5dd219f Add completions for git-commit 2019-10-19 19:28:17 +02:00
Collin Styles
cc84dc7510 Add completions for git rev-parse 2019-10-19 19:26:12 +02:00
Collin Styles
486bc71cf8 Add completions for git reflog 2019-10-19 19:26:12 +02:00
Collin Styles
9384801e3c Add completions for push subcommand to git stash 2019-10-19 19:26:12 +02:00
Collin Styles
63e840995e git-reset: Don't suggest branch completions if -- is present
If "--" is present in the command line, it's usually safe to assume that
the user is going to want to complete a file tracked by git so let's
only suggest branches if "--" isn't present.
2019-10-19 19:26:12 +02:00
Collin Styles
3de3a34e79 Add completion for git log --date=human 2019-10-19 19:26:12 +02:00
Collin Styles
bd71308788 Add git completions for range-diff 2019-10-19 19:26:12 +02:00
Johannes Altmanninger
00fc1306d0 completions/git: allow arbitrary refs in git push remote src:dest
When there is already a "src:", we assume that it is a valid ref and
just complete "dst". This allows completion of dest if src is e.g. a
commit SHA (completing all possible refs would probably impact
performance).

See issue #3035.
2019-10-19 16:10:25 +02:00
Johannes Altmanninger
aa1bf9f277 sphinx: honor changes in static html assets
Also fix custom.css.
2019-10-19 14:52:24 +02:00
Fabian Homborg
e0d623d4b7 tests/test_util: Fix wrong argument in delta
This spewed errors because the `math` invocation got no second
operand:

    Testing file checks/sigint.fish ... math: Error: Too few arguments
    '1571487730 -'

but only if the `date` didn't do milliseconds, which is the case on
FreeBSD and NetBSD.

(also force the variable to be global - we don't want to have a
universal causing trouble here)
2019-10-19 14:27:47 +02:00
Fabian Homborg
fc0c39b6fd expand: Remove unused includes
sys/sysctl.h is deprecated on glibc, so it leads to warnings.
According to fa4ec55c96, it was included for KERN_PROCARGS2 for
process expansion, but process expansion is gone, so it's unused now.

(there is another use of it in common.cpp, but that's only on FreeBSD)

Also 1f06e5f0b9 only included
tokenizer.h (present since the initial commit) if KERN_PROCARGS2
wasn't available, so it can't have been important.

This builds and passes the tests on:

- Archlinux, with glibc 2.30
- Alpine, with musl
- FreeBSD
- NetBSD
2019-10-19 14:20:53 +02:00
艾雨寒 ArielAxionL
9ea8aa072f add a completion for zstd support
An update has been released by Arch Linux official to support the packages for zstd compression.

> https://www.archlinux.org/news/required-update-to-recent-libarchive/
2019-10-19 12:55:30 +02:00
Johannes Altmanninger
b7f35f949e Do not import vars that are equivalent to a universal exported var
Universal exported variables (created by `set -xU`) used to show up
both as universal and global variable in child instances of fish.

As a result, when changing an exported universal variable, the
new value would only be visible after a new login (or deleting the
variable from global scope in each fish instance).

Additionally, something like `set -xU EDITOR vim -g` would be imported
into the global scope as a single word resulting in failures to
execute $EDITOR in fish.

We cannot simply give precedence to universal variables, because
another process might have exported the same variable.  Instead, we
only skip importing a variable when it is equivalent to an exported
universal variable with the same name.  We compare their values after
joining with spaces, hence skipping those imports does not change the
environment fish passes to its children. Only the representation in
fish is changed from `"vim -g"` to `vim -g`.

Closes #5258.
This eliminates the issue #5348 for universal variables.
2019-10-19 12:41:57 +02:00
Johannes Altmanninger
5e274066e3 Always return absolute path in path_get_cdpath
Fixes #6220
2019-10-19 12:38:17 +02:00
Johannes Altmanninger
868eba5e80 Fix error on typing Alt-l on a token that starts with a dash 2019-10-19 12:31:09 +02:00
ridiculousfish
c8332bae8c sucess -> success, failiure -> failure 2019-10-18 18:36:03 -07:00
ridiculousfish
9652b3e11b Clean up job_or_process_extent
This had a bad merge which happened to work, plus some other nonsense.
2019-10-18 15:24:28 -07:00
Johannes Altmanninger
2fed311d4c builtin commandline: fix flags -p and -j not splitting on && and ||
Fixes #6214
2019-10-18 09:36:52 +02:00
Johannes Altmanninger
ed8b0c8c0c Add completions for the kakoune editor
[ci skip]
2019-10-17 21:50:27 +02:00
Delapouite
a2672dea7a doc: fix links pointing to history-search section
[ci skip]
2019-10-17 21:45:36 +02:00
Fabian Homborg
9c4edb68ff Add g++ completions that wrap gcc
Should be alright for a first pass.

Fixes #6217.

[ci skip]
2019-10-17 17:45:47 +02:00
Mahmoud Al-Qudsi
b29fd88cad [rustup] Add completions for rustup show and rustup profile
[ci skip]
2019-10-16 19:05:53 -05:00
Mahmoud Al-Qudsi
9a99836c74 [rustup] Fix string replace coalesce of multiple $argv
[ci skip]
2019-10-16 18:57:03 -05:00
ridiculousfish
3c727173c2 Include ctime in history_file.h
Fixes a build failure on FreeBSD.

Fixes #6210
2019-10-16 11:55:40 -07:00
Johannes Altmanninger
a6f5d9c0eb Merge pull request #6103 from krobelus/expand-arg-to-short-option
Completion: complete argument to last of a group of short options
2019-10-16 11:37:04 +02:00
Johannes Altmanninger
eae1683033 Completion: complete argument to last of a group of short options
Consider a group of short options, like -xzPARAM, where x and z are options and z takes an argument.

This commit enables completion of the argument to the last option (z), both within the same
token (-xzP) or in the next one (-xz P).

complete -C'-xz' will complete only parameters to z.
complete -C'-xz ' will complete only parameters to z if z requires a parameter
otherwise, it will also complete non-option parameters

To do so this implements a heuristic to differentiate such strings from single long options. To
detect whether our token contains some short options, we only require the first character after the
dash (here x) to be an option. Previously, all characters had to be short options. The last option
in our example is z. Everything after the last option is assumed to be a parameter to the last
option.

Assume there is also a single long option -x-foo, then complete -C'-x' will suggest both -x-foo and
-xy. However, when the single option x requires an argument, this will not suggest -x-foo.
However, I assume this will almost never happen in practise since completions very rarely mix
short and single long options.

Fixes #332
2019-10-16 11:30:50 +02:00
Johannes Altmanninger
41bcf77e25 fix comment 2019-10-16 11:25:11 +02:00
Johannes Altmanninger
203a2e7af4 completions/grep: specify some required parameters 2019-10-16 11:23:53 +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
Johannes Altmanninger
c64aec9019 Merge pull request #6211 from Delapouite/doc-dirs
doc: add links between dirs, pushd and popd
2019-10-16 11:19:10 +02:00
Delapouite
e3caaed73f doc: add links between dirs, pushd and popd
[ci skip]
2019-10-16 09:05:59 +02:00
ARifleman
876176fc94 Added 'Nord' color scheme to sample color schemes (#6201) 2019-10-15 23:18:18 -07:00
ridiculousfish
ca11b5edc8 Add a simple test for SIGINT out of loops 2019-10-15 22:33:53 -07:00
ridiculousfish
cc1c973025 Remove job_flags as an enum, just use a struct
This removes an over-complicated flag implementation, replacing it with
just a plain struct.
2019-10-15 14:40:58 -07:00
Johannes Altmanninger
cff721afda sphinx: highlight current page in the site navigation
Fixes #6189
2019-10-15 22:25:23 +02:00
Z. Grace Moreau
4c63ae357a update CHANGELOG 2019-10-15 13:05:08 -07:00
Z. Grace Moreau
ff2baf2591 add completions for Visual Studio Code CLI tool 2019-10-15 13:05:08 -07: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
ridiculousfish
35671dd9f0 Clean up and unify pipes and redirections
This cleans up how pipes and redirections are recognized by the parser,
and unifies pipes and redirections into a single type.
2019-10-15 11:26:41 -07:00
Johannes Altmanninger
2d2e15b63d Silently ignore recursive calls to complete -C without parameter
In e167714899 we allowed recursive calls
to complete. However, some completions use infinite recursion in their
completions and rely on `complete` to silently stop as soon as it is
called recursively twice without parameter (thus completing the
current commandline). For example:

complete -c su -s -xa "(complete -C(commandline -ct))"
su -c <TAB>

Infinite recursion happens because (commandline -ct) is an empty list,
which would print an error message.  This commmit explicitly detects
such recursive calls where `complete` has no parameter and silently
terminates.  This enables above completion (like before raising the
recursion limit) while still allowing legitimate cases with limited
recursion.

Closes #6171
2019-10-15 13:36:28 +02:00
Johannes Altmanninger
cf3b24cf62 fix typo 2019-10-15 13:30:21 +02:00
Mark Stosberg
087500e7b9 doc: document relative path support for source.
[ci skip]
2019-10-14 18:58:30 +02:00
Aaron Gyes
d1970c7f2e read_ni: be more specific in error if a file can't be read
for example, `fish /etc` now tells us "Is a directory"

make a couple char constants wchar_t constants
2019-10-14 01:43:35 -07:00
Aaron Gyes
5d84d3fe48 reader.cpp: remove unused pointer in read_ni
literally prehistoric in git blame
2019-10-14 00:42:03 -07:00
ridiculousfish
4b6de8b4a3 Clean up a stale comment. 2019-10-13 23:05:55 -07:00
ridiculousfish
c160492d42 Remove tok_t::redirected_fd
This wasn't used for anything.
2019-10-13 23:04:18 -07:00
ridiculousfish
1a65e18ba8 Clean up some tokenization
Remove TOK_NONE
Turn token_type into an enum class
Make next() turn a maybe_t<tok_t> instead of a bool
2019-10-13 16:06:16 -07:00
ridiculousfish
82eca4bc86 Run clang-format on all files
The main change here is to reorder headers.
2019-10-13 15:50:48 -07:00
ridiculousfish
e73e9c3e2e Ensure that clang-format places config.h first in header list 2019-10-13 15:45:02 -07:00
Andy
39671e6b19 Fix ranger options: choosefile(s), choosedir
Source <ee344c896e/ranger/core/main.py (L293-L303)>
2019-10-13 12:14:08 -07:00
Sergei Morozov
478f54c035 Added PHPUnit shell completion 2019-10-13 12:13:34 -07:00
Per Bothner
d502ad2c25 Prefer using clr_eos to clear "remaining lines"
This is both more efficient than multiple clr_eol sequences,
and also works better with shell-integration.
2019-10-13 12:12:44 -07:00
Delapouite
09a97528a9 doc: add cross-refs between if and else commands 2019-10-10 18:17:10 +02:00
Clément Martinez
1f35b146de Add grub-mkrescue completions 2019-10-10 18:16:32 +02:00
aca
8c5aca599f completions/fzf: completion for fzf 2019-10-10 18:16:00 +02:00
Aaron Miller
15ed682bfa Fix options after --argument-names to function (#6188)
This stops reading argument names after another option appears. It does not break any previous uses and in fact fixes uses like

```fish
function foo --argument-names bar --description baz
```

* `function` command handles options after argument names (Fixes #6186)

* Removed unneccesary test
2019-10-10 18:09:26 +02:00
jalr
3d1e9423c2 cd: Add test for changing to a dir starting with a - char 2019-10-10 18:06:11 +02:00
jalr
2e6ab0b418 cd: Fix test for too many args 2019-10-10 18:06:11 +02:00
Greg Anders
055a332133 Only print extra newlines for multi-line prompts (#6179)
Corrects #6110

BSD `seq` produces a down-counting sequence when the second argument is
smaller than the first, e.g.:

    $ seq 2 1
    2
    1
    $

While GNU `seq` produces no output at all:

    $ seq 2 1
    $

To accommodate for this behavior, only run `seq` when we are sure that
the second argument is greater than or equal to the first (in this case,
the second argument `line_count` should be greater than 1).
2019-10-08 19:14:51 +02:00
Fabian Homborg
ff18b2a09a Fix tests
This didn't account for the path differing from when I ran the test
manually.

Sorry!
2019-10-08 19:12:56 +02:00
Bruno Heridet
7dbbd16d0a doc: add missing down-line and up-line (#6177)
[ci skip]
2019-10-08 18:01:32 +02:00
Fabian Homborg
a7913c3a10 function: Reject invalid variable names for --argument-names
Fixes #6147.
2019-10-07 21:26:41 +02:00
matoruru
422441e903 Add completions/sfdx.fish (#6149)
* Add completions/sfdx.fish

* completions/sfdx.fish: add completion for options

* completions/sfdx.fish: add a completion for --manifest(-x) option which need package.json

* completions/sfdx.fish: replace redundant function with already existing one
2019-10-07 17:32:56 +02:00
Bruno Heridet
9c651d7db0 doc: add link to feature flags in fish command
[ci skip]
2019-10-07 17:15:39 +02:00
Johannes Altmanninger
f91c725ff0 Fix caret position of invalid expansion in command position
Fixes #5812
2019-10-06 13:43:05 -07:00
ridiculousfish
e2952f230b Revert #6139
Revert "gut gpg.fish/gpg1.fish/gpg2.fish; migrate functionality to __fish_complete_gpg.fish"

This reverts commit d558218d03.

Revert "break version-specific completions out into independent function;"

This reverts commit 9160e77b01.

Revert "split gpg2- and gpg1-specific completions to conditional block"

This reverts commit a069b95f63.
2019-10-06 12:35:07 -07:00
LawAbidingCactus
d558218d03 gut gpg.fish/gpg1.fish/gpg2.fish; migrate functionality to __fish_complete_gpg.fish 2019-10-06 12:31:42 -07:00
LawAbidingCactus
9160e77b01 break version-specific completions out into independent function;
document changes
2019-10-06 12:31:42 -07:00
LawAbidingCactus
a069b95f63 split gpg2- and gpg1-specific completions to conditional block
This allows gpg.fish to account for both gpg versions.
2019-10-06 12:31:31 -07:00
Johannes Altmanninger
9b86d5dd16 Export all local exported variables in a new scope
Fixes #6153
2019-10-06 12:10:21 -07:00
Per Bothner
afb8f42f39 Emit omitted-newline string before fish_prompt event
See issue #6118 "omitted-newline string emitted after fish_prompt event"
2019-10-06 10:52:12 -07:00
Per Bothner
dfc45f3e10 Clear line if new indentation greater than old.
Make sure initial indentation is skipped, rather than written as spaces.
This is a tweak to pull request #5928.
2019-10-06 10:34:55 -07:00
Fabian Homborg
eca1fcad90 CHANGELOG: Document the new binding changes
[ci skip]
2019-10-06 15:38:11 +02:00
Fabian Homborg
8bc44b2bff CHANGELOG: Introduce sub-headers for interactive improvements
These are just too many and too different to keep them under one heading.
2019-10-06 15:31:58 +02:00
Fabian Homborg
e5c84e63b6 Document prepend-sudo
[ci skip]
2019-10-06 15:22:25 +02:00
Greg Anders
0f802eaad8 Add default \es keybinding for "prepend sudo" 2019-10-06 15:17:49 +02:00
Greg Anders
e5fc8abefe Fix default Alt+W keybinding (#6110)
* Fix default Alt+W keybinding

The old keybinding would chop off the last line of the `whatis` output
when using a multi-line prompt. This fix corrects that.

* Make variable local and remove unneeded if statement

* Test that token is non-empty
2019-10-06 15:14:10 +02:00
madblobfish
87dee7ad1c improved ansible-vault completions 2019-10-06 15:13:06 +02:00
Kon Doumou
e44d207d64 sudo keywork is ignored when alt+h is pressed
if `sudo` is in the beggining of the command string, then at alt+h press
the manual of the following command is shown instead.

Fixes https://github.com/fish-shell/fish-shell/issues/5982
2019-10-06 15:12:02 +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
Johannes Altmanninger
7017a2fcf9 Unexpand abbreviations' variable names before completing them
Fixes #6166
2019-10-06 14:42:42 +02:00
Sergei Morozov
1602902e12 Improved shell completion for Composer
1. Added missing commands and arguments.
2. Removed alternative spelling of some commands (e.g. clear-cache|clearcache) since a choice of spelling is not really useful for completion.
3. Fixed a typo: np-ansi → no-ansi.
4. Removed redundant backslash in front of $COMPOSER_HOME.

The updated completion was initially generated using the bamarni/symfony-console-autocomplete package and then incorporated into the existing code.
2019-10-05 12:54:20 -07:00
domdom
76f4b65981 Add prefix history search 2019-10-05 11:27:32 -07:00
David Adam
9516fa5017 complete: document change in 22ce8c23c6 2019-10-04 07:13:17 +08:00
David Adam
75bd821495 CHANGELOG: minor work on 3.1.0 2019-10-04 07:11:04 +08:00
Johannes Altmanninger
d74b774f51 Fix paginate binding (\ep) for multiline jobs
Reproducer: type `: \<RET><M-p>`. This used to print an error due to builtin test receiving
too many arguments.

It looks like (commandline -j) can return multiple items, because a job can be broken up in multiple
lines terminated by backslashes.
2019-10-03 21:40:25 +02:00
Johannes Altmanninger
e167714899 Raise the recursion limit of complete
Users should generally prefer to use complete --wraps but this
corrects some unexpected behavior.

Fixes #3474
2019-10-03 21:25:19 +02:00
Johannes Altmanninger
aa011f70a8 Print an error when complete reaches its recursion limit 2019-10-03 21:25:19 +02: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
Fabian Homborg
70fc2611bd webconfig: Escape abbrs properly
Fixes #6120
2019-10-02 20:37:24 +02:00
Bruno Heridet
0df464ca2c doc: mention the disown command in the jobs section - fix #5530 2019-10-02 18:34:53 +02:00
Sergei Morozov
2fa3c6298b Unmarked the colo(u)r options of the git command as requiring an argument
According to man, the argument is optional:

$ man git
       --color[=WHEN], --colour[=WHEN]
2019-10-02 16:21:41 +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
Collin Styles
dae4faa512 Fix completions for abbr --erase 2019-09-28 00:19:39 +02:00
aca
4747bdd7e7 completions/go: add/improve completion
- completion for go mod/generate
- better description for go help
2019-09-26 21:59:41 +02:00
David Adam
3ca4dbb2b9 CHANGELOG: work on 3.1.0
[ci skip]
2019-09-26 22:59:02 +08:00
Aaron Gyes
19c575e116 builtin functions: colorize output if interactive
We can also get rid of the | fish_indent --ansi stuff in type.fish
2019-09-25 04:18:06 -07:00
Johannes Altmanninger
8063d6d0b8 complete builtin: suggest commands for options --comand and --wraps 2019-09-25 17:00:48 +08:00
Johannes Altmanninger
2dbbaa6a97 Honor required parameters in completions for builtins
This adds the -r (or -x) flag to completions of builtins' options that have a required_argument.
2019-09-25 17:00:48 +08:00
Aaron Gyes
8230755bfd Make sure rgb_color_t doesn't grow
For years the comment above the class claimed it was 4 bytes, but
it had grown to 5. Add a static_assert() to prevent that from
happening again.
2019-09-24 23:34:10 -07:00
Jakob Landbo
ed0a7f5cdb completions/git: Added autostash option to rebase 2019-09-24 21:59:26 +08:00
David Adam
10f38c6865 CHANGELOG: work on 3.1.0
[ci skip]
2019-09-23 23:29:43 +08:00
Aaron Gyes
e6c72f74a8 make rgb_color_t smaller
rgb_color_t was 5 bytes, now it's 4 again.
big arrays holding colors are going to be smaller.
2019-09-22 21:16:30 -07:00
ridiculousfish
91c4dad812 Revert "use std::tolower"
This reverts commit a3db4128bc.

This broke the build.
2019-09-22 15:33:08 -07:00
Aaron Gyes
a3db4128bc use std::tolower 2019-09-22 15:47:22 -07:00
ridiculousfish
a19d9b2e73 Add a test for #6130 2019-09-22 14:06:38 -07:00
Johannes Altmanninger
bc533ad939 Fix completion inside command substitution inserting spurious quote
Reproducer: type `: (: ""`, move the cursor after the second colon and press tab.
2019-09-22 14:06:38 -07:00
Aaron Gyes
eef62b8848 Correct wc completions for macOS, BSDs. 2019-09-22 14:02:22 -07:00
Johannes Altmanninger
d99c19cc03 Fix completions for chown (#6132)
Reproducer: type `chown --f<TAB>`
2019-09-22 10:01:41 -07:00
ridiculousfish
70a1d8314c Optimize parse_color 2019-09-21 19:36:56 -07:00
Aaron Gyes
902c6ec4a3 Check for {g,}date existance before trying --version 2019-09-21 18:42:55 -07:00
Aaron Gyes
7804a5e477 Revert "Correctly detect the presence of gdate"
This reverts commit 4b181df254.

It will result in systems without a GNU date having a literal "N"
in the output.
2019-09-21 18:40:32 -07:00
ridiculousfish
6bbf3726fc Relnote expand-abbr and self-insert changes 2019-09-21 16:06:19 -07:00
ridiculousfish
e1f46d22de Simplify space binding and fix search
With the new support for self-insert inserting a bound sequence,
the default binding for space as expanding abbreviations can be simplified
to just `self-insert expand-abbr`. This also fixes the bug where space
would cancel pager search.
2019-09-21 16:06:19 -07:00
ridiculousfish
18b56637f7 self-insert bindings to insert their own sequence
Prior to this fix, self-insert would always wait for a new character.
Track in char_event what sequence generated the readline event, and then
if the sequence is not empty, insert that sequence.

This will support implementing the space binding via pure readline
functions.
2019-09-21 15:58:57 -07:00
ridiculousfish
1ecbe363d0 Correct an assertion message 2019-09-21 15:17:09 -07:00
ridiculousfish
3f7bc7232e yank_POP -> yank_pop 2019-09-21 14:31:22 -07:00
ridiculousfish
5f64972908 Do not try the same (command, wraps) pair more than once when completing
This prevents runaway wrap chains. Fixes #5638.
2019-09-21 14:09:38 -07:00
ridiculousfish
77dbe109e0 Allow cancellation out of expanding a runaway wrap chain
This makes it easier to control-C out of a completion.
2019-09-21 13:11:45 -07:00
ridiculousfish
3f2f44ce73 Introduce reader_test_should_cancel
This centralizes the logic around cancellation due to either sigint or a
stale threaded operation.
2019-09-21 13:07:55 -07:00
ridiculousfish
95aea7839d Show wrap targets when printing a function
Fixes #1625
2019-09-21 12:48:51 -07:00
ridiculousfish
a1f1abc137 Stop passing true to escape_string
It wants a flags, not a boolean.
2019-09-21 12:40:24 -07:00
Johannes Altmanninger
a7ea7648c3 Completion: maintain cursor position when there is no completion
Previously, tab-completion would move the cursor to the end of the current token, even
if no completion is inserted. This commit defers moving the cursor until we insert a completion.

Fixes #4124
2019-09-21 12:50:52 -07:00
Johannes Altmanninger
e9e92178a9 completions: simplify prefix computation 2019-09-21 12:50:52 -07:00
Johannes Altmanninger
6c5c0a73eb remove useless call, fix comment 2019-09-21 12:50:52 -07:00
ridiculousfish
4b181df254 Correctly detect the presence of gdate
Fixes some test spew
2019-09-21 12:12:08 -07:00
ridiculousfish
d7c695114a Switch from subprocess.run to subprocess.check_call
Restores Python 2 compatibility in conf.py
2019-09-21 12:04:21 -07:00
ridiculousfish
56c0b99799 Format conf.py with black 2019-09-21 11:58:58 -07:00
David Adam
66fd52aa15 fish_xgettext: update translation generation for new build system
Closes #6123.
2019-09-21 22:29:19 +08:00
LawAbidingCactus
d4a5ef1703 rewrite __fish_complete_gpg2_key_id to produce better output 2019-09-21 22:04:17 +08:00
LawAbidingCactus
b8ba04dcf4 fix compatibility with BSD sed 2019-09-21 22:04:17 +08:00
LawAbidingCactus
2f67cb341c add remaining gpg2-specific completions; formatting 2019-09-21 22:04:17 +08:00
LawAbidingCactus
1a59731ea7 Create updated completions for gpg2 2019-09-21 22:04:17 +08:00
LawAbidingCactus
d2e9ee290c rewrite __fish_complete_gpg_key_id to produce better output 2019-09-21 21:58:59 +08:00
David Adam
8e0aa03c4a cmake: sphinx-manpages requires fish_indent for version number
Fixes issue #6216.

Problem introduced in 3b8505bebe.
2019-09-21 16:32:24 +08:00
Aaron Gyes
102ddd2b79 tests/checks/complete.fish: don't check unsorted lines 2019-09-19 15:44:15 -07:00
Aaron Gyes
6459682c93 Work around indeterminant ordering for complete test
Not a cool fix but it should work
2019-09-19 15:35:25 -07:00
Aaron Gyes
9486af8805 tests: fix date --version printing junk, update interactive.fish 2019-09-19 15:06:51 -07:00
Aaron Gyes
53a3533285 Add tests for complete (no args) output
Hopefully this should catch things if the output gets broken again.
2019-09-19 15:01:09 -07:00
Aaron Gyes
5c06e68115 tests: add a lame gdate-based ms-precision timer if installed
I got tired of seeing ' ... ok (0 sec)' so now with GNU date/gdate
installed there is millisecond output shown. One can get rough
nanoseconds from gdate.
2019-09-19 14:26:53 -07:00
Aaron Gyes
2b7b70a64f Ellipsis OCD 2019-09-19 11:48:37 -07:00
Aaron Gyes
fda8ad429b parse_util.cpp: remove truncate_string()
We already have something that does this
2019-09-19 10:32:07 -07:00
Aaron Gyes
cb79d8fa97 Colorize complete output
If interactive, `complete` commands are highlighted like they would
be if typed. Adds a little fun contrast and it's easier to read.

Moved a function out of fish_indent to highlight.h
2019-09-19 04:27:33 -07:00
Aaron Gyes
620761b9b9 complete: print long option names for less common ones
we now print --long options for ones I arbitrarily decided
are less likely to be remembered.

Also fixed the `--wraps` items at the end not being escaped
2019-09-19 04:21:24 -07:00
Aaron Gyes
e9ee2fb089 complete: support -k (--keep-files) in printed completions 2019-09-19 02:01:33 -07:00
Aaron Gyes
7302dcc12b complete: terser output with short options
Most of our completion scripts are written using the short options
anyhow, and this makes it less likely the output will span several
lines per command
2019-09-19 01:50:26 -07:00
David Adam
3b8505bebe sphinx: get version number from built binary 2019-09-19 15:05:39 +08:00
David Adam
3ae12ac4d3 Revert "Escape separators (colon and equals) to improve completion"
This reverts commit f7dac82ed6 from pull
request #6059.

As discussed in #6099, this caused a regression in some completions (eg
dd).
2019-09-19 14:38:16 +08:00
Aaron Gyes
b7dd060dec sample prompts: use $USER instead of (whoami) 2019-09-18 23:35:16 -07:00
Aaron Gyes
f35e18bb9b complete.cpp: don't double escape commands in complete output
The argument to --command was escaped both here and in
append_switch(), potentially producing incorrect output
2019-09-18 16:21:21 -07:00
Johannes Altmanninger
eea3bd5fc3 completions/git: improve completion for git restore and git switch
- suggest relevant files for git restore
- add `-r` to require an argument for some options
2019-09-18 14:08:43 -05:00
Johannes Altmanninger
ec834820f5 completions/git: handle 2 RM and 2 RD files
This commit makes git completions aware of files that are both staged as renamed, and have unstaged
modifications/are deleted.

__fish_git_files now potentially prints these files twice:

$ __fish_git_files renamed modified
foo   Renamed file
foo   Modified file

Fixes #6031
2019-09-18 14:03:11 -05:00
Johannes Altmanninger
8baea8b157 Do not add a space after completion if one is already there
Example: type `cd --help --help`, move the cursor inside the first `--help` and press tab.
This used to add redundant spaces.
2019-09-18 14:02:24 -05:00
Aaron Gyes
22811ebcf6 Remove unused macros
Most just left behind after actual code was moved into different files.
2019-09-18 01:31:03 -07:00
Aaron Gyes
715836cb0a builtin_set_color.cpp: remove unnecessary .c_str() 2019-09-18 00:09:23 -07:00
Aaron Gyes
5f05d9734c builtin_set_color.cpp: colorize set_color --print-colors
Each named color is now printed in that color, only if
hooked up to a TTY. Shouldn't affect scripts.
2019-09-18 00:05:09 -07:00
Aaron Gyes
61f0756fe6 builtins: Use standard builtin.h error macros more 2019-09-17 22:04:33 -07:00
David Adam
a10547018e cmake: don't install realpath manpage on non-macOS systems 2019-09-17 20:54:11 +08: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
ridiculousfish
d903fe6073 Relnote fix for #3189 2019-09-14 16:42:28 -07:00
ridiculousfish
533ee65963 Allow binding nul (zero byte)
This sequence can be generatd by control-spacebar. Allow it to be bound
properly.

To do this we must be sure that we never round-trip the key sequence
through a C string.
2019-09-14 16:37:57 -07:00
ridiculousfish
5f6ee7f30f Use the gold linker if available
The big reason to do this is that the gold linker doesn't complain about
_sys_nerr and _sys_errlist.
2019-09-14 15:09:08 -07:00
ridiculousfish
5afcc439a5 Clean up input_terminfo_get_sequence 2019-09-14 14:59:01 -07:00
ridiculousfish
5ebcd3de98 Remove some unnecessary string formatting 2019-09-14 14:22:37 -07:00
ridiculousfish
06269ed67d Remove NOT_A_WCHAR
It's now unused.
2019-09-14 13:18:04 -07:00
ridiculousfish
8747018cbc Use maybe_t in unescape_string_internal 2019-09-14 13:17:22 -07:00
ridiculousfish
fa1dab040b Use maybe_t in read_unquoted_escape 2019-09-14 12:54:38 -07:00
ridiculousfish
7ea3255eef Correct the exit expect test
There was an errant space which is not matched; this seems to cause problems
only on one machine for mysterious reasons.
2019-09-14 12:46:57 -07:00
ridiculousfish
cc5e29734b Use maybe_t in string_last_char 2019-09-14 11:56:02 -07:00
Johannes Altmanninger
0ecfc25961 Fix highlighting of redirection to - (close file descriptor)
Fixes #6092
2019-09-14 13:04:27 -05:00
David Adam
77ef2ef6c3 jobs: return success when a job is found via --last
Closes #6104.
2019-09-14 13:01:36 -05:00
David Adam
737c2d156d history: fixup exact matching by default
Work on #6070. Fixup from 54ed2ad440.
2019-09-11 23:12:10 +08:00
David Adam
e935f5ce89 docs: fix formatting of name of shells
Work on review comments in #5312.

[ci skip]
2019-09-11 12:25:27 +08:00
David Adam
ccdef3936f docs: improve introduction section
Work on review comments in #5312.
2019-09-11 12:20:08 +08:00
Mahmoud Al-Qudsi
58cd1a5140 Eschew hard-coding rustup components in favor of a hack
[ci skip]
2019-09-10 03:23:59 -05:00
Mahmoud Al-Qudsi
32546d6491 Reorder rustup completions to avoid undefined function error
[ci skip]
2019-09-10 03:23:55 -05:00
Mahmoud Al-Qudsi
85f93ff002 Add dynamic completions for rustup
[ci skip]
2019-09-09 20:55:08 -05:00
ridiculousfish
56d2942f59 Minor cleanup of how jobs store their command string 2019-09-09 09:07:25 -07:00
ridiculousfish
535a448d0e Remove an errant fprintf 2019-09-08 15:44:07 -07:00
ridiculousfish
b2fe2f9ff3 Correct escaping and add tests for bracket completion
Add some tests for new bracket completion behavior, and fix an escaping
bug where \\[ was incorrectly marked as escaping.
2019-09-08 15:43:20 -07:00
Johannes Altmanninger
bc3dde997d escape square brackets in an argument before completing it
fixes #5831
2019-09-08 12:27:58 -07:00
ridiculousfish
e79df33e3a Disallow parsing 'and' and 'or' as commands
Except for and --help and or --help

Fixes #6089
2019-09-08 11:09:32 -07:00
ridiculousfish
fa6bac1283 Correctly implement and --help and or --help 2019-09-08 10:42:24 -07:00
Johannes Altmanninger
962bfa9668 Escape literal dollar signs in quoted completions
Closes #6060.
2019-09-07 13:52:40 -05:00
Mahmoud Al-Qudsi
f854e3dc29 Try fixing __has_attribute errors on Travis macOS 2019-09-05 23:11:59 -05:00
Mahmoud Al-Qudsi
80610addf8 Avoid warnings about unsupported clang::weak_import w/ GCC on macOS 2019-09-05 23:00:46 -05:00
Mahmoud Al-Qudsi
912421f1cb Switch away from awk for __fish_print_hostnames
By not manipulating each line or even each file at a time, we can go
back to `string` and piece together a pipeline that will execute
significantly faster than shelling out to `awk` will. This also removes
one of the few dependencies on `awk` in the codebase.

With this change, `__fish_print_hostnames` now finishes ~80% faster than
it used to a few commits back.
2019-09-05 22:44:09 -05:00
Mahmoud Al-Qudsi
1db861b4db Clean & slightly optimize SSH hostnames handling in __fish_print_hostnames 2019-09-05 22:44:09 -05:00
Mahmoud Al-Qudsi
06317f0a98 Optimize __fish_print_hostnames hosts file loading/parsing
Reordering the `getent hosts` and read from `/etc/hosts` combined with
minimizing shelling and job invocations for parsing the output results
in a profiled and benchmarked ~42% decrease in the time it takes to run,
and that's on a machine with a very small hosts list in the first place.

This update also fixes the hadling of IPv6 addresses in the hosts
output, which were previously ignored, and ignores 127.* loopback
addresses in addition to the 0.0.0.0 address (plus adds support for
shorter IPv4 notations).
2019-09-05 22:44:09 -05:00
ridiculousfish
b760fd9064 Correctly set g_use_posix_spawn at launch again 2019-09-05 11:00:52 -07:00
LawAbidingCactus
c20a9ea477 fix compatibility with BSD sed
Closes #6087.
2019-09-03 15:35:04 +08:00
Johannes Altmanninger
f7dac82ed6 Escape separators (colon and equals) to improve completion
Fish completes parts of words split by the separators, so things like
`dd if=/dev/sd<TAB>` work.
This commit improves interactive completion if completion strings legitimately
contain '=' or ':'.  Consider this example where completion will suggest
a:a:1 and other files in the cwd in addition to a:1

touch a:1; complete -C'ls a:'

This behavior remains unchanged, but this commit allows to quote or escape
separators, so that e.g. `ls "a:<TAB>` and `ls a\:<TAB>` successfully complete
the filename.

This also makes the completion insert those escapes automatically unless
already quoted.
So `ls a<TAB>` will give `ls a\:1`.

Both changes match bash's behavior.
2019-09-02 14:27:21 -07:00
David Adam
54ed2ad440 history: implement exact matching by default for delete
Brings behaviour into line with documented and intended behaviour.
Closes #6070.
2019-09-02 22:59:52 +08:00
Nathan Galt
8b84f4f117 Add completions/tokei.fish
Closes #6085.
2019-09-02 22:37:01 +08:00
Nathan Galt
76195dfe1d Update bat completions from 0.11.0 to 0.12.0
Closes #6084.
2019-09-02 22:35:08 +08:00
Nathan Galt
635dafeb9c Update bat completion to support cache command
Closes #6076.
2019-09-02 22:32:47 +08:00
Shun Sakai
5221d723ca Added patool completions 2019-09-01 17:28:46 -07:00
ridiculousfish
9fd9f70346 Restore terminal modes after sending SIGCONT
Fixes #2214

Thanks to @bruce-hill for the patch.
2019-09-01 17:24:23 -07:00
Johannes Altmanninger
068aba1902 remove redundant call (done in constructor of completion_t) 2019-08-31 12:05:49 -07:00
Shun Sakai
42c6b9c176 Implemented the completions of all options of git restore and git switch (#6054)
* Implemented the completions of all options of `git restore` and `git switch`

* Apply requested changes
2019-08-30 11:31:35 +02:00
Sergei Morozov
753f49dba9 Added git rebase --rebase-merges[=(rebase-cousins|no-rebase-cousins)] to completion
See https://git-scm.com/docs/git-rebase/2.18.0#git-rebase--r
2019-08-27 22:04:55 +02:00
LawAbidingCactus
35b64b0470 add completions for qubes-gpg-client 2019-08-27 15:20:07 +08:00
Mahmoud Al-Qudsi
af4b54e635 Change WSL version check to a hard error, but include a bypass
Instead of warning (debug level 1), we now emit an error (debug level 0) if a known bad version of
WSL is detected. However, `FISH_NO_WSL_CHECK` can now be defined to skip both the check and the
startup message.
2019-08-25 18:50:17 -05:00
Mahmoud Al-Qudsi
44022e65c2 Revert "Remove the WSL warning"
This reverts commit 5101bdeb9f.
2019-08-25 18:29:46 -05:00
ridiculousfish
99c498d3d7 Use move semantics in trim and history_item_t 2019-08-25 13:37:06 -07:00
adiabatic
dd34bf0ba6 Create bat.fish 2019-08-23 21:49:55 -07: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
David Adam
e3eb8f758b README: note that chsh requires logout/login
Suggested in #6051.

[ci skip]
2019-08-22 21:24:17 +08:00
Shun Sakai
ecacf34693 Added git restore and git switch completions
These commands were added in version 2.23.
2019-08-22 20:25:02 +08:00
ridiculousfish
903e7c6d5e history_lru_cache_t to use move semantics 2019-08-18 12:14:07 -07:00
ridiculousfish
9b2b7f787e Migrate history profiling to flog 2019-08-18 11:14:45 -07:00
ridiculousfish
0da87d3e5f Equip history_item_t with a default constructor 2019-08-17 20:01:44 -07:00
adiabatic
85f57d1d33 Create hledger.fish 2019-08-16 21:25:41 -07:00
ridiculousfish
5101bdeb9f Remove the WSL warning
This warning is annoying and there is no way to disable it.

Ping #5661. Ping #5298. Closes #6038
2019-08-16 20:59:53 -07:00
ridiculousfish
f137f24d75 Initialize a const variable
Fixes #6041
2019-08-16 17:50:41 -07:00
ridiculousfish
124def8f4b Un-changelog the history fix
Turns out the bug never actually shipped in a release; it bisected to
3ae5b23971
2019-08-15 19:59:35 -07:00
ridiculousfish
a87e0183df Stop rewriting the history file on every command
fish is designed to append to the history file in most cases. However
save_internal_via_appending was never returning success, so we were
always doing the slow rewrite path. Correctly return success.

Fixes #6042
2019-08-15 13:49:17 -07:00
ridiculousfish
7ab291775a Add flog logging to history 2019-08-15 13:42:23 -07:00
Tobias Hernstig
332b305f81 Documentation: Initialization files paths
Adds slash to end of example paths to align with that
~/.config/fish/conf.d/ had a slash at the end.
2019-08-14 20:36:08 +02:00
Aaron Gyes
47798510bd tests, CHANGELOG: regex-easyesc
Oops, missed these the first time around.
2019-08-13 22:56:31 -07:00
Aaron Gyes
edc8d5d7a3 string-replace-fewer-backslashes -> regex-easyesc
This shortens a very long feature name.

See discussion in #5805
2019-08-13 22:32:04 -07:00
ridiculousfish
ce178fd6fd Make escape_yaml_fish_2_0 and unescape_yaml_fish_2_0 static
They no longer need to be exposed.
2019-08-12 09:22:21 -07:00
ridiculousfish
3ae5b23971 Migrate append_history_item_to_buffer to history_file.cpp
Also eliminate history_output_buffer_t, which no longer does anything useful.
2019-08-12 09:17:10 -07:00
ridiculousfish
6eebe4cc83 Eliminate history_lru_item_t
history_item_t is enough
2019-08-11 14:26:22 -07:00
ridiculousfish
6b008c3eae Stop caching the lowercase string contents in history items 2019-08-11 13:41:04 -07:00
ridiculousfish
92e9a34b47 Simplify history_output_buffer_t 2019-08-11 13:08:31 -07:00
ridiculousfish
2ddde381d4 Clean up next_line() interface and implementation 2019-08-11 12:57:09 -07:00
ridiculousfish
91987a4548 Migrate history file format stuff into new file history_file.cpp
Breaks up the history.cpp monolith.
2019-08-11 12:45:04 -07:00
ridiculousfish
74357bac91 Remove an errant semicolon 2019-08-10 16:47:45 -07:00
ridiculousfish
fd5d8c1949 Remove __packed
We can use the new C++11 enum type feature to stop using this non-portable
__packed.
2019-08-10 16:04:05 -07:00
ridiculousfish
30fd526fc1 Correct an out-of-bounds index in screen
Fixes #6037
2019-08-10 14:32:55 -07:00
adiabatic
ab6fd6554f Add completions/cwebp.fish 2019-08-08 18:51:13 +02:00
LawAbidingCactus
cc6a82c878 clean up formatting 2019-08-08 18:49:26 +02:00
LawAbidingCactus
cfc18c86a3 document fish_cursor_visual and blinking cursors 2019-08-08 18:49:26 +02:00
LawAbidingCactus
1693b53221 document changes in CHANGELOG.md 2019-08-08 18:49:26 +02:00
LawAbidingCactus
36b9f1ed9c document vi mode cursor configuration 2019-08-08 18:49:26 +02:00
Fabian Homborg
eb80a90959 Update copyright information
Axel left in 2009, so anything after that let's just credit to "contributors".

See #6036.

[ci skip]
2019-08-08 18:47:36 +02:00
David Adam
a3fa011ef5 fish.spec: BuildRequire python-argparse on RHEL/CentOS 6 2019-08-08 14:10:11 +08:00
ridiculousfish
0dc5eaeb97 reader_expand_abbreviation_in_command to return maybe_t<wcstring> 2019-08-06 16:09:23 -07:00
Daniel Bretoi
575fdb5492 add missing flag 2019-08-06 20:19:12 +02:00
Fabian Homborg
2c32885a2d Fix build on old gcc by using old-school initialization
It appears Gcc 4.8 doesn't get this particular expression, so we just
revert to the old `type foo = bar` style from the new `type foo{bar}`.

Fixes #6027.
2019-08-05 18:08:13 +02:00
adiabatic
9b89b820da Add completions/src.fish 2019-08-05 12:18:29 +02:00
ridiculousfish
29dede8139 Migrate parse_util_detect_errors to a free function 2019-08-04 14:49:56 -07:00
Fabian Homborg
2c3bc1e857 Fix grep wrapper completions
[ci skip]
2019-08-04 15:34:33 +02:00
Fabian Homborg
3296bb6c3b Fix apt-show-versions command name
[ci skip]
2019-08-04 15:34:33 +02:00
Fabian Homborg
3fd567749c Fix latex tool completions
Again the wrapping was used the wrong way around.

(also why on earth are there like fifty of these darn things?)

[ci skip]
2019-08-04 15:34:32 +02:00
Fabian Homborg
ab1b2b84f6 Move netcat completions to an autoloadable name
The file was named "netcat", but it completes a tool named "nc", so it
wouldn't be loaded.

[ci skip]
2019-08-04 15:34:32 +02:00
Fabian Homborg
8ea034837d Remove pacsrv completions
These have been broken for 4 years (completed `pacsrc` instead), and I
can't find the tool anywhere.

[ci skip]
2019-08-04 15:34:32 +02:00
Fabian Homborg
0fc4b415ac Fix rgrep completions
This used the arguments the wrong way around.
2019-08-04 15:34:32 +02:00
adiabatic
75a6ad602f completions/canto.fish: s/cnato/canto/ 2019-08-04 15:21:41 +02:00
mk2
0083555925 Move __fish_complete_abook_formats to abook 2019-08-04 15:20:32 +02:00
Shun Sakai
67cf50eda4 Added completions of languages developed by Microsoft
* csc, csi, vbc - .NET Compiler Platform (Roslyn)
* fsharpc, fsharpi - F# compiler and REPL environment
* tsc - TypeScript compiler
2019-08-03 14:47:59 -07:00
ridiculousfish
73bf60754c Don't assign jobs to fish's pgrp if there's no external process
Fixes #6011
2019-08-03 14:43:55 -07:00
Klaus Alexander Seistrup
28a17c4b05 Document that the : command now always exits successfully 2019-08-03 18:14:12 +02:00
Klaus Alexander Seistrup
7046d251d9 Make sure nop command always suceeds 2019-08-03 18:14:12 +02:00
ridiculousfish
95c97619c6 Use cbegin() in one place in reader 2019-07-31 14:23:41 -07:00
Mark Stosberg
d2455bdd5a Document alternates for common arrow key usage.
Arrow keys are often not conveniently located on keyboards, so the use of arrow keys for common keyboard shortcuts can be a turn-off for some.

I found that fish supports alternate keybindings for these cases but I didn't seem them documented in these places where the arrow keys versions are highlighted.
2019-07-31 14:09:43 +02:00
Fabian Homborg
6500765256 Allow switch with something that expands to nothing
Meaning empty variables, command substitutions that don't print
anything.

A switch without an argument

```fish
switch
   case ...
end
```

is still a syntax error, and more than one argument is still a runtime
error.

The none-argument matches either an empty-string `case ''` or a
catch-all `case '*'`.

Fixes #5677.

Fixes #4943.
2019-07-31 14:08:28 +02:00
Fabian Homborg
57ffd18787 tests/checks/set: Make a temporary XDG_CONFIG_HOME
This test uses universal variables, and so it can fail when run
multiple times.

It might be a good idea to do this in general, but for now let's just
try it here.
2019-07-31 13:52:36 +02:00
David Adam
38f6296fdc README: add Xcode install instructions
Closes #5961.

[ci skip]
2019-07-31 09:17:59 +08:00
ridiculousfish
5b90fa0bda Add a missing reference to a range-based for loop 2019-07-29 21:39:05 -07:00
Miha Filej
ec2ff8de24 docs/bind: Mention history-token-search-*
[ci skip]
2019-07-29 19:08:26 +02:00
ridiculousfish
a33f0eb636 Clean up some logic around when process exit events are sent 2019-07-28 14:36:57 -07:00
ridiculousfish
a40a4c0c54 Add some new tricks to fish_test_helper
Allow fish_test_helper to report if it is in the foreground, and to SIGINT
its parent.
2019-07-27 11:00:07 -07: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
ridiculousfish
822b53c67a Don't color a whole string invalid because of an unclosed quote
When syntax highlighting a quoted string, if the string is not closed,
only show the opening quote as an error, not the whole string.
2019-07-24 12:43:47 -07:00
ridiculousfish
c0053ceef5 highlighter_t to return color array directly
Saves some copying and allocations.
2019-07-24 12:42:18 -07:00
Frederik Gladhorn
ffcf5a5e03 completions/git: Add git cherry
See for example: https://git-scm.com/docs/git-cherry
git cherry is quite helpful when trying to findout if merges between
branches are complete, when there were cherry-picks in addition to
merges.
2019-07-24 16:02:30 +02:00
ridiculousfish
554ee240b3 Correct handling of explicitly separated output when all elements are empty
Previously when propagating explicitly separated output, we would early-out
if the buffer was empty, where empty meant contains no characters. However
it may contain one or more empty strings, in which case we should propagate
those strings.

Remove this footgun "empty" function and handle this properly.

Fixes #5987
2019-07-21 14:00:27 -07:00
ridiculousfish
e8c6de8055 Correctly export empty universal variables
Fixes #5992
2019-07-21 12:45:29 -07:00
ridiculousfish
01dff25f62 Remove test3
This is now handled by littlecheck
2019-07-21 12:18:28 -07:00
ridiculousfish
07d1607e58 Port tests/test3.in to littlecheck
This just tests 'set'
2019-07-21 12:18:28 -07:00
ridiculousfish
97c4794424 Properly mark tests_dir as a dependency of test_prep
Allows for running a subset of tests immediately after build system config.
2019-07-21 11:21:50 -07:00
ridiculousfish
1f854ec284 Accept a pwd in resolve_file_redirections_to_fds
Conceptually allow multiple of these to run in parallel
2019-07-20 17:25:25 -07:00
Fabian Homborg
9e6ae1cbef completions/git: Fix error with git config
This passed "--get" when it should have been "get".

Fixes #6000.

[ci skip]
2019-07-20 14:25:45 +02:00
Fabian Homborg
2f86c3d447 docs: Mention unicode for fish_emoji_width
[ci skip]
2019-07-19 15:29:56 +02:00
adiabatic
6ca56fe0cb tmutil.fish: Add completions for local-snapshots subcommands (#5995)
* tmutil.fish: Add local-snapshot subcommands

* tmutil.fish: Add completion for thinlocalsnapshots

* tmutil.fish: Run fish_indent

* tmutil.fish: Remove duplicate destinationinfo
2019-07-17 08:40:15 +02:00
ridiculousfish
8ec568d21f Add some tests to path_apply_working_directory 2019-07-15 17:56:06 -07:00
Fabian Homborg
ef403129e4 fish_vi_key_bindings: Remove duplicate \cc binding
Already done in the shared bindings.

[ci skip]
2019-07-15 21:04:23 +02:00
Fabian Homborg
33dbd98200 Remove x-bit from function 2019-07-15 21:02:08 +02:00
Fabian Homborg
56e122866c fish_svn_prompt: Shorten a return 2019-07-15 21:02:08 +02:00
Per Bothner
2dcaf4f5c0 Emit 'fish_cancel' at end of __fish_cancel_commandline.
This helps with shell integration - see issue #5973
"shell-integration - how distringuish winch repaint from ctrl-c cancel".
2019-07-15 21:01:49 +02:00
Fabian Homborg
47e9e8ab8a fish_vcs_prompt: Stop at first success
Closes #5980.
2019-07-15 17:32:22 +02:00
Mahmoud Al-Qudsi
90882ca9ee [docs] Clarify behavior of --no-scope-shadowing and variable lifetimes 2019-07-13 22:47:04 -05:00
Mahmoud Al-Qudsi
57508b46d2 [docs] Fix build warning plus the rendering of the escaped space
Use a `:code:` role for the escaped space, it avoids the nastiness of
the whitespace mangling in inline literals.
2019-07-13 22:33:55 -05:00
ridiculousfish
8181883111 Minor refactoring of logic around when a job wants to claim the terminal
Introduce should_claim_terminal() which encapsulates an && exprsesion which
was previously repeated a lot.
2019-07-12 13:31:56 -07:00
ridiculousfish
d577eb4aaa Only use the global fish_complete_path and fish_function_path
Prior to this fix, fish would attempt to react if a local fish_complete_path
or fish_function_path were set. However this has never been very well tested
and will become impossible with concurrent execution. Always use the global
values.
2019-07-12 12:40:12 -07:00
Mahmoud Al-Qudsi
7ee675afcf Update aws and aws s3 completions
Improve handling of switches interjected between the commands, and
support for completing buckets automatically for secondary+ parameters
to `aws s3`.
2019-07-11 21:22:25 -05:00
ridiculousfish
cdcea0f00d Port setenv tests to littlecheck 2019-07-09 10:02:50 -07:00
Peter Lithammer
9d47c46a7a Suppress shell function lookup for ssh during scp completion
This prevents functions or aliases to run during tab completion of
remote files for the `scp` command.
2019-07-08 22:12:44 +02:00
tomKPZ
42f38bb806 Fix status code coloring for nim prompt 2019-07-07 19:36:17 +02:00
ridiculousfish
0e4fe53718 clang-format some files 2019-07-06 13:11:50 -07:00
ridiculousfish
bc0329f775 Add wcstolower
Converts a string to lowercase. Eliminates some loops that did this
explicitly.
2019-07-06 12:19:34 -07:00
ridiculousfish
b1a1b617f1 child_setup_process to accept new termowner directly
Soon we will have more complicated logic around whether to call tcsetpgrp.
Prepare to centralize the logic by passing in the new term owner pgrp,
instead of having child_setup_process perform the decision.
2019-07-03 18:06:35 -07:00
ridiculousfish
8282369f45 child_setup_process to stop passing the process
child_setup_process only cares about whether we are in a forked child, not
the entire process structure. Narrow the parameter.
2019-07-03 17:48:52 -07:00
Leonard Hecker
ca5427865d Fixed invalid assignments in fish_print_git_action 2019-07-03 17:37:44 +02:00
Fabian Homborg
65eb4cd9d3 eval tests: Fix path
I tested this manually (`littlecheck.py -s fish=fish tests/checks/eval.fish`) from the base directory, which means I got
"tests/checks/eval", while the real test gets "checks/eval".

I then reran `make test_fishscript`, but that didn't pull in the
updated test - we should really handle that better.
2019-07-03 15:14:49 +02:00
Fabian Homborg
f1fa8d5f5b Port complete tests to littlecheck 2019-07-03 13:02:15 +02:00
Fabian Homborg
87b05d3111 Port eval tests to littlecheck 2019-07-03 12:54:42 +02: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
4ae18951ee Add NetBSD's error to the bad-option test
I'm kinda close to just checking `.*fish: .*option.*Z.*`
2019-07-02 23:48:25 +02:00
Fabian Homborg
d775c584a5 Port realpath tests to littlecheck
I'm gonna add more tests to this and I don't want to touch the old stuff.

Notice that this needs to have the output of the complete_directories
test adjusted because this one now runs later.

That's something we should take into account in future.
2019-07-02 23:05:50 +02:00
Fabian Homborg
7d3bec1297 test.fish: Notice littlecheck failures
This failed to propagate the exit status. Sorry!
2019-07-02 22:50:16 +02:00
Fabian Homborg
5133287873 CHANGELOG: List path_helper changes
Just replace the issue number because this is effectively a
replacement of the previous.

[ci skip]
2019-07-02 22:18:40 +02:00
Tim Riley
d1be300ac7 Emulate path_helper more faithfully when constructing paths on macOS
Previously, elements already existing in the path variable would keep their position when the path was being constructed from the config files. This caused issues given that $PATH typically already contains "/usr/bin:/bin" when fish initializes within a macOS terminal app. In this case, these would keep their position at the front of the $PATH, even though the system path_helper configs explicitly place them _after_ other paths, like "/usr/local/bin". This would render binaries in "/usr/local/bin" as effectively "invisible" if they also happen to live in "/usr/bin" as well. This is not the intended

This change makes the __fish_macos_set_env config function emulate the macOS standard path_helper behavior more faithfully, with:

1. The path list being constructed *from scratch* based on the paths specified in the config files
2. Any distinct entries in the exist path environment variable being appended to this list
3. And then this list being used to *replace* the existing path environment variable

The result, for a vanilla fish shell on macOS, is that the $PATH is now set to:

    /usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin

Where previously it was set to:

    /usr/bin /bin /usr/local/bin /usr/sbin /sbin

This new $PATH exactly matches the order of paths specified in `/etc/paths`.
2019-07-02 22:17:46 +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
ridiculousfish
09e4f8ff42 Refactor how the terminal is transferred to jobs
Centralize the logic around when a job acquires the terminal.
2019-06-29 15:58:36 -07:00
ridiculousfish
2931d869d5 Remove the foreground job property
This was not used consistently and was confused with the foreground job
flag. Whether a job is foreground is mutable, so it should remain a flag.
2019-06-29 15:54:49 -07:00
ridiculousfish
98ba7d7790 Simplify maybe_assign_terminal()
Move this out of postfork, it is not called after fork.
2019-06-29 14:36:14 -07:00
ridiculousfish
f58960ba01 Add a DIE("unreachable") in should_claim_process_group_for_job
Fixes a gcc warning.
2019-06-29 11:40:52 -07:00
ridiculousfish
4a2c709fb1 Eliminate shell_is_interactive
We used to have a global notion of "is the shell interactive" but soon we
will want to have multiple independent execution threads, only some of
which may be interactive. Start tracking this data per-parser.
2019-06-29 11:28:26 -07:00
ridiculousfish
3f1d7bbdc5 Call tcsetpgrp in child processes before resetting signal handlers
Also ignore SIGTTIN and SIGTTOU across the tcsetpgrp call.

Hopeful fix for #5963
2019-06-28 11:54:55 -07:00
Fabian Homborg
4c022a708f tests: Simplify directory-redirect test
This doesn't need the indirection, since it was only an invocation
test because we couldn't express it in the old runner.
2019-06-28 20:48:11 +02:00
ridiculousfish
262fe65121 Correctly mark a node when erasing an exported variable
Fixes #5965
2019-06-28 11:22:49 -07:00
ridiculousfish
3c800e0608 Make history tests more robust
history now often writes to the history file asynchronously, but the history
test expects to find the text in the file immediately after running the
command. Hack a bit in history to make this test more reliable.
2019-06-28 11:16:27 -07:00
ridiculousfish
e3f94f4b72 Centralize signal handling into a single function
Prior to this diff, fish had different signal handling functions for
different signals. However it was hard to coordinate when a signal needed
to be the default handler, and when it was custom. In #5962 we overwrote
fish's custom WINCH handler with the default_handler when fish script asked
for WINCH to be handled.

Just have a single big signal handler function. That way it can never be
set to the wrong thing.

Fixes #5969
2019-06-28 10:51:22 -07:00
ridiculousfish
8254342339 Remove the useless second parameter from signal_handle
It was always set to 1.
2019-06-28 10:33:03 -07:00
ridiculousfish
f3736e8fdf fish to claim a job's pgroup if the first process is fish internal
When executing a job, if the first process is fish internal, then have
fish claim the job's pgroup.

The idea here is that the terminal must be owned by a pgroup containing
the process reading from the terminal. If the first process is fish
internal (a function or builtin) then the pgroup must contain the fish
process.

This is a bit of a workaround of the behavior where the first process that
executes in a job becomes the process group leader. If there's a deferred
process, then we will execute processes out of order so the pgroup can be
wrong. Fix this by setting the process group leader explicitly as fish
when necessary.

Fixes #5855
2019-06-26 17:30:51 -07:00
ridiculousfish
f7e2e7d26b Don't generate exit events for jobs created from within event handlers
Add a new job property from_event_handler, and do not create exit events for
such jobs. This prevents easy accidental infinite recursion.
2019-06-26 17:30:51 -07:00
Fabian Homborg
d7a9bdf5c3 reader: Do the "delete" part for delete-or-exit
For some reason this is supposed to do a delete-*char*.

I was assuming the function was broken and it should delete the entire
line.

Fixes #5967.
2019-06-26 22:53:19 +02:00
Fabian Homborg
22d2620716 Rerun all interactive tests once
They are *all* flakey enough that we regularly see them fail, at least
on Travis.
2019-06-26 21:26:20 +02:00
Fabian Homborg
4d035cbd10 Port bind tests to littlecheck 2019-06-26 21:19:40 +02:00
Fabian Homborg
fdf0a661cf Port andandoror test to littlecheck 2019-06-26 21:19:40 +02:00
Fabian Homborg
8e11f802b4 Port alias test to littlecheck 2019-06-26 21:19:40 +02:00
Fabian Homborg
9462aacc5c Port abbr test to littlecheck 2019-06-26 21:19:40 +02:00
Fabian Homborg
21805759a3 Port math test to littlecheck
This shows one bit where not trimming whitespace would make sense.
2019-06-26 21:19:40 +02:00
Fabian Homborg
2f19ec1c34 Port count test to littlecheck 2019-06-26 21:19:40 +02:00
ridiculousfish
b672e1891e Port signal tests to littlecheck 2019-06-26 11:07:46 -07:00
Fabian Homborg
cdbd0891f7 Remove invocation tests
These are now all performed by littlecheck, so there's no need for the
entire target anymore.
2019-06-25 22:31:45 +02:00
Fabian Homborg
a33c2f0bce Port config tests to littlecheck
This required a bit of thinking.

What we do is we have one test that fakes $HOME, and then we do the
various config tests there.

The fake config we have is reused and we exercise all of the same codepaths.
2019-06-25 22:31:06 +02:00
Fabian Homborg
10949648e7 Port qmark1 test to littlecheck
This one just needs a random home.
2019-06-25 22:31:06 +02:00
Fabian Homborg
5c7b7fd609 Readd bad-switch and directory-redirection tests
Made possible by the power of regex.
2019-06-25 22:30:58 +02:00
Fabian Homborg
b9c1f4b122 Remove ported tests 2019-06-25 21:00:13 +02:00
Fabian Homborg
21667850b3 tests/test.fish: Normalize littlecheck output
This prints a green "ok" with the duration, just like the rest of the
tests.

Note that this clashes a bit with
https://github.com/ridiculousfish/littlecheck/pull/3.

(also don't check for python again and again and again)
2019-06-25 20:57:37 +02:00
Fabian Homborg
9d5620c170 Port most of the invocation tests to littlecheck
This is a bit weird sometimes, e.g. to test the return status (that
fish actually *returns $status*), we use a #RUN line with %fish
invoking %fish, so we can use the substitution.

Still much nicer.

The missing scripts are those that rely on config.
2019-06-25 20:56:29 +02:00
Fabian Homborg
d415350aaf reader: Add delete-or-exit bind function
This is an important binding and should therefore be in C++.
2019-06-25 19:57:00 +02:00
Fabian Homborg
c392a05db0 functions/__fish_anypython: Also try python{3,2}.7
NetBSD!!!!! *shakes fist*
2019-06-25 19:40:22 +02:00
Fabian Homborg
93d9fa4551 tests/test.fish: Run littlecheck with any python
Some operating systems don't have a "python" symlink, so we just run
it with the first python we find.
2019-06-25 19:25:36 +02:00
Fabian Homborg
7778e62bd7 CI: Add python dependencies
Littlecheck needs it.
2019-06-25 19:17:53 +02:00
Fabian Homborg
1bba77e485 Port string tests to littlecheck
`wc -l tests/string.*`
  329 tests/string.err
  422 tests/string.in
  520 tests/string.out
 1271 total

`wc -l tests/checks/string.fish`
 555 tests/checks/string.fish

and it looks nicer. 'nuff said.
2019-06-25 17:26:36 +02:00
Fabian Homborg
77d8487078 string: Also stop printing documentation
Especially as, in this case, the documentation is quite massive.

Caught by porting string's test to littlecheck.

See #3404 - this was already supposed to be included.
2019-06-25 17:26:30 +02:00
Fabian Homborg
60edc9a45d Port argparse tests to littlecheck
This is a nice test (ha!) for how this works and what littlecheck can
do for us.

1. Input is now the actual file, not "Standard Input" anymore. So
any errors mentioning that now include the filename.
2. Regex are really nice for filenames, but especially for line
numbers
3. It's much nicer to have the output where it's created, instead of
needing to follow three files at the same time.
2019-06-25 16:11:24 +02:00
Fabian Homborg
cc1388a78a Upgrade littlecheck to allow whitespace before comments
Necessary for test files that pass fish_indent.
2019-06-25 16:11:24 +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
caedf01c00 Revert "Latch signal handlers"
This reverts commit 7ed1022cf4.

Fixes #5962.
2019-06-25 11:25:09 +02:00
Fabian Homborg
3bc392a6b3 functions/__fish_print_hostnames: Check getent's status
This previously effectively checked `string split ' '`s return status,
which was false if it didn't split anything. And while that should be
true if getent fails (because it should produce no output), it's also
true if it doesn't print a line with multiple aliases. Which should be
fairly typical.

Instead we use our new-found $pipestatus to check what getent returns,
in the assumption that it'll fail if it doesn't support hosts.

Follow up to 8f7a47547e.

[ci skip]
2019-06-25 08:40:31 +02:00
Fabian Homborg
9cd29e5166 cmake: Add -Wno-redundant-mode
This warns about one bit in env_dispatch, where a comment explains
that the move *is* necessary, on a different libc++.
2019-06-24 22:11:49 +02:00
Fabian Homborg
8f7a47547e functions/__fish_print_hostnames: Don't run getent hosts twice
`getent hosts` is expensive-ish - ~50ms, so we don't want to run it
twice just to figure out it works.

Apparently this works everywhere but CYGWIN and possibly older
OpenBSD, but we don't want to explicitly blacklist those.

[ci skip]
2019-06-24 19:19:31 +02:00
ridiculousfish
27e4d1d62d Revert "Revert "Don't service ioport completions if data is available on stdin""
This reverts commit 005e6f2ab8.

This allows new text entry to take priority over highlighting, improving the
performance of pasting.
2019-06-23 16:45:06 -07:00
ridiculousfish
89fb408eb6 Migrate some job flags into const properties struct
This helps clarify which parts of a job are mutable, and which are constant.
2019-06-23 12:42:44 -07:00
ridiculousfish
5362161343 Call tcsetgrp() in child processes again
25afc9b377 made this unnecessary by
having child processes wait for a signal after fork(), but this change
was later reverted. If we artificially slow down fish (e.g. with a sleep)
after the fork call, we see commands getting backgrounded by mistake.

Put back the tcsetgrp() call.
2019-06-23 12:42:44 -07:00
ridiculousfish
8255c01edb Rename setup_child_process to child_setup_process
Try to name all functions called after fork with "child" prefix.
2019-06-23 12:42:44 -07:00
Shun Sakai
e7b42615c8 Add FFmpeg completions (#5922)
* Add FFmpeg completions

* Fix to use builtin command
2019-06-23 16:40:26 +02:00
Fabian Homborg
e921bd60c3 docs: Build index, tutorial and faq as man pages
This was clearly intended for index, but because it was called "fish"
it was overwritten by the "fish" command man page.

I also added the tutorial and faq. Both of those might not be *ideal*
as man pages (the tutorial makes references to colors that won't show
up), but it's better to provide them than not.

Hat-tip to @wwared

See #5521.

[ci skip]
2019-06-23 16:16:44 +02:00
David Adam
8f3a0dcc8b cmake: harmonise argument to foreach/endforeach
Fixes a warning introduced in 40d91b7e77.
2019-06-23 16:00:40 +08:00
ridiculousfish
40d91b7e77 Allow running test suites independently
This makes test_low_level, test_interactive, test_invocation, and
test_fishscript independent. This allows running a smaller subset of tests.

To prevent all tests running in parallel, we also have new targets
serial_test_low_level, serial_test_interactive, etc. which have the
dependency chain that enforces serial execution.
2019-06-22 14:17:10 -07:00
ridiculousfish
db703c273d Remove some stale comments from Tests.cmake
These comments were used to refer back to the autotools build, but the
autotools build is no more and CMake is now the source of truth.
2019-06-22 13:12:49 -07:00
Fabian Homborg
8bfaf9e7ef Add test for erasing unloaded functions
Not perfect, but better than nothing.
2019-06-22 18:20:54 +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
Lily Ballard
fe2ec1e4f8 Merge pull request #5943 from lilyball/string_collect
Add new `string` subcommand `string collect`
2019-06-22 00:30:20 -07:00
infix
ae2c40ebdb Updated DNF auto completion 2019-06-21 09:24:37 -07:00
Fabian Homborg
6c05005f0f docs: Document indexing double-variable-expansion
Fixes #5886.

[ci skip]
2019-06-19 12:56:01 +02:00
Fabian Homborg
370f5356a1 Move "character has no narrow representation" to flog
This was a warning, which is kind of ridiculous, as it's inactionable
error spew.

Fixes #2815.
2019-06-19 12:36:38 +02:00
ridiculousfish
9b9c6e312c Improve the docs from DEBUG_LEVEL to CATEGORY_GLOB
This stuff still isn't documented properly.
2019-06-17 09:07:43 -07:00
yogendra
ad1d81a090 Fix5910 documentation update 2019-06-17 09:01:30 -07:00
Lily Ballard
181e44d331 Invert the flag for string collect
Instead of requiring a flag to enable newline trimming, invert it so the
flag (now `--no-trim-newlines`) disables newline trimming. This way our
default behavior matches that of sh's `"$(cmd)"`.

Also change newline trimming to trim all newlines instead of just one,
again to match sh's behavior.
2019-06-16 16:40:14 -07:00
Lily Ballard
b41e5cbbb7 Add string collect
The `string collect` subcommand behaves quite similarly in practice to
`string split0 -m 0` in that it doesn't split its output, but it also
takes an optional `--trim-newline` flag to trim a single trailing
newline off of the output.

See issue #159.
2019-06-16 15:51:57 -07:00
ridiculousfish
5b5887ea99 Correct capitalization of complete_and_search 2019-06-16 14:38:27 -07:00
ridiculousfish
fcf0593dfb Port printf tests to littlecheck and teach the tester how to run it
This adds support for .check files inside the tests directory. .check
files are tests designed to be run with littlecheck.

Port printf test to littlecheck and remove the printf.in test.
2019-06-16 14:10:41 -07:00
ridiculousfish
476185748f Add littlecheck.py
This will be the new testing tool replacing the diff-based tests.

Imported from https://github.com/ridiculousfish/littlecheck
Version e28281273e54745c7d7aabeeb4b085af477d584b
2019-06-16 13:27:06 -07:00
Lily Ballard
5fd3bf79f5 Don't trim trailing whitespace on .rst files
Our existing .rst files have lines with trailing whitespace in them,
which I can only assume is deliberate, so update the editorconfig to
stop trimming trailing whitespace for these files.
2019-06-15 22:36:07 -07:00
ridiculousfish
360116221a Switch history_t to use owning_lock internally
This removes a lot of tricky manual locking. It also removes the "main
thread" dependency.
2019-06-14 20:49:17 -07:00
yogendra
6bed255a52 Fix Issue 5910 2019-06-14 08:56:42 -07:00
ridiculousfish
1c66d56d3a Add debug categories for reaping processes 2019-06-13 14:29:13 -07:00
Fabian Homborg
b4792bde19 Remove brew completions
Leave a note in place

Fixes #5892.

[ci skip]
2019-06-12 20:42:20 +02:00
Fabian Homborg
77103ddbab Dishonour
[ci skip]
2019-06-12 10:22:46 +02:00
Fabian Homborg
4db7efb569 docs: Fix fish_opt options
This said "--required" when the option is called "--required-val".

Fixes #5931.

[ci skip]
2019-06-11 14:10:39 +02:00
Fabian Homborg
e363552ef0 screen: Include termios for NetBSD
Otherwise it won't build.
2019-06-11 11:34:14 +02:00
Mahmoud Al-Qudsi
cfe1f1db9e Fix build on FreeBSD 12.0 with stock Clang
`isspace()` is in `ctype.h`.
2019-06-10 16:51:42 -05:00
ridiculousfish
aa950e5c13 Provide an optimized override of get_pwd_slash() 2019-06-10 10:26:33 -07:00
Fabian Homborg
38a7c77e4b Re-double-super-fix tilde completion crash
Yeah, I was too clever with the operators here.

Fixes #5929.
2019-06-10 18:50:40 +02:00
Fabian Homborg
5e78d6dcc9 CHANGELOG math "x"
[ci skip]
2019-06-10 18:46:06 +02:00
Fabian Homborg
d1ca392393 math: Allow "x" for multiplication
It's always a bit annoying that `*` requires quoting.

So we allow "x" as an alternative, only it needs to be followed by
whitespace to distinguish it from "0x" hexadecimal notation.
2019-06-10 18:45:10 +02:00
ridiculousfish
42138f00c6 Remove wchdir()
It's unused, and will soon be dangerous as the process-wide cwd will
lose meaning.
2019-06-10 09:37:08 -07:00
ridiculousfish
6637ccd3a2 Keep an fd for the cwd in the parser
To support distinct parsers having different working directories, we need
to keep the working directory alive, and also retain a non-path reference
to it.
2019-06-10 09:27:51 -07:00
ridiculousfish
6ce85aebc6 Switch file_io_t to store a wcstring
We no longer use file_io_t after fork(). We don't need to use a malloc'd
string any more. Use a wcstring.
2019-06-09 17:43:25 -07:00
ridiculousfish
0f9f00b54b Add a test that verifies cd handling in pipes 2019-06-09 16:08:00 -07:00
ridiculousfish
1baa479bbf Eliminate the global list of scoped transient commandlines
Store this in a parser's libdata instead.
2019-06-09 14:11:25 -07:00
ridiculousfish
421cf92380 Use a generation count for uvars exports
Because an exported universal variable must be exported in all variable
stacks, explicit invalidation is infeasible. Switch the universal variables
to a generation count.
2019-06-09 13:48:07 -07:00
ridiculousfish
7dffaf1a02 Reimplement exported variable change detection
Prior to this fix, fish would invalidate the exported variable list
whenever an exported variable changes. However we soon will not have a
single "exported variable list." If a global variable changes, it is
infeasible to find all exported variable lists and invalidate them.

Switch to a new model where we store a list of generation counts. Every
time an exported variable changes, the node gets a new generation. If the
current generation list does not match the cached one, then we know that
our exported variable list is stale.
2019-06-09 13:25:30 -07:00
ridiculousfish
79ee59adc0 Convert the create_export_array message to flog 2019-06-09 13:22:18 -07:00
Per Bothner
e05a0716e5 Make sure initial indentation is done using cursor move, not spaces.
The goal to allow a terminal to reliably distinguish user input
from indentation and prompts, in the context of shell integration.
2019-06-09 11:36:47 -07:00
Per Bothner
7448e7825f Avoid code duplication relating to screen clearning in s_update. 2019-06-09 11:32:26 -07:00
Mahmoud Al-Qudsi
c9a77bb474 Optimize history search reset checking
`history_search.active()` is an atomic read, whereas
`command_ends_history_search(..)` is a little bit heavier.
2019-06-08 21:07:32 -05:00
ridiculousfish
be97499106 Revert "Revert "Add a test for autoload_t""
This reverts commit 2507162f80.

Put back the autoload test.
2019-06-07 12:12:43 -07:00
Per Bothner
18cf2b8509 Rename incorrect is_single_byte_escape_seq to is_three_byte_escape_seq. 2019-06-07 08:31:52 +02:00
Per Bothner
060a068a3c Fix comment for is_single_byte_escape_seq. 2019-06-07 08:31:52 +02:00
Fabian Homborg
a3bdc6a233 docs/tutorial: Fix list link
[ci skip]
2019-06-06 22:52:14 +02:00
Fabian Homborg
13ed29aca8 docs/tutorial: Fix gitter link
Urgh.

[ci skip]
2019-06-06 22:50:43 +02:00
Fabian Homborg
a12c377f0c docs/tutorial: Mention gitter channel
We also might want to remove the mailing list and/or IRC channel as I
think most devs aren't on them anymore, but let's just add the channel
that I prefer first.

[ci skip]
2019-06-06 20:01:26 +02:00
Fabian Homborg
6d05d93275 docs/tutorial: Expand
[ci skip]
2019-06-06 20:00:11 +02:00
Fabian Homborg
3641410a06 docs/tutorial: Misc
[ci skip]
2019-06-06 19:38:41 +02:00
Fabian Homborg
8eb0769996 docs/tutorial: Rewrite exit status section
We've kinda forgotten the "tutorial" part of this.

[ci skip]
2019-06-06 19:38:19 +02:00
Fabian Homborg
a154384ff4 docs/tutorial: Remove some empty lines
[ci skip]
2019-06-06 19:30:35 +02:00
Fabian Homborg
de3f862731 docs/tutorial: Rewrite exports section
See #5920.

[ci skip]
2019-06-06 19:28:14 +02:00
Fabian Homborg
223b515ba1 docs/tutorial: Mention VAR=VAL syntax
That's the thing we're replacing, so we should mention it.

[ci skip]
2019-06-06 19:17:49 +02:00
Fabian Homborg
d338f74e6d docs/tutorial: Put exit status with combiners and conditionals
It was awkwardly sandwhiched inbetween variables and exports.

[ci skip]
2019-06-06 19:17:09 +02:00
Fabian Homborg
53216940c4 docs: Clarify when exporting is necessary
See #5920.

[ci skip]
2019-06-06 19:14:11 +02:00
Fabian Homborg
23671f696e docs: Simplify variable scope/exporting a bit
[ci skip]
2019-06-06 19:14:11 +02:00
Fabian Homborg
b6eddc75bc docs: Remove -# formatting
That was supposed to be displayed like a list item, but it's displayed
verbatim in the html output at least, so it looks weird.

[ci skip]
2019-06-06 19:14:11 +02:00
Fabian Homborg
c89883b6ab docs/faq: Fix header formatting
[ci skip]
2019-06-06 19:14:11 +02:00
Fabian Homborg
d1d5716ae1 CHANGELOG read history
[ci skip]
2019-06-06 19:14:11 +02:00
David Adam
84171e0c25 travis: turn on errors for some serious compiler warnings
See
2e38cf2a4b (commitcomment-20563617)
2019-06-06 21:13:00 +08:00
Fabian Homborg
ae59fdeda5 src/builtin_read: Remove more references to fish_history 2019-06-06 15:07:46 +02:00
Fabian Homborg
c0ca4d3236 functions/history: Read the search term if none is given
Fixes #5791.
2019-06-06 15:07:46 +02:00
Fabian Homborg
51fcb79d96 Remove read history
This was undocumented, not all that useful and potentially unwanted.

In particular it means that things like

   mysql -p(read)

will still keep the password in history.

Also it allows us to simply implement asking for the history deletion
term.

See #5791.
2019-06-06 15:07:46 +02:00
ridiculousfish
fc99d6c7af clang-format all files 2019-06-03 20:30:48 -07:00
ridiculousfish
d1fc8d5f71 Improve the iothread port structure
Mark both fds in the ioport as non-blocking, and allow bulk reads.
2019-06-03 16:42:51 -07:00
ridiculousfish
b478f877ee Clean up g_fork_count
Make it static and atomic
2019-06-03 12:58:59 -07:00
ridiculousfish
bc103c2ea6 Make the list of event handlers thread safe 2019-06-03 12:33:10 -07:00
ridiculousfish
ead16958b2 Make set_signal_observed thread-safe 2019-06-03 12:32:48 -07:00
Shun Sakai
c566756f3b Fix long option name of zypper 2019-06-03 16:36:03 +02:00
ridiculousfish
ad301ab3a0 Remove an incorrect shadowing use of principal_parser 2019-06-03 02:55:36 -07:00
ridiculousfish
ff55249447 Make events per-parser
This makes the following changes:

1. Events in background threads are executed in those threads, instead of
being silently dropped

2. Blocked events are now per-parser instead of global

3. Events are posted in builtin_set instead of within the environment stack

The last one means that we no longer support event handlers for implicit
sets like (example) argv. Instead only the `set` builtin (and also `cd`)
post variable-change events.

Events from universal variable changes are still not fully rationalized.
2019-06-03 02:48:35 -07:00
ridiculousfish
890c1188ab Instantize and rationalize locking around the input mapping set
Hypothetically a background thread could invoke builtin_bind, etc.
Protect the set of input bindings with a lock.
2019-06-02 22:54:01 -07:00
ridiculousfish
2ef4d982df Clean up some dependencies in input.h 2019-06-02 17:49:52 -07:00
ridiculousfish
ad35fb7457 Make the bind mode per-parser
Eliminates a use of principal_parser
2019-06-02 16:57:52 -07:00
ridiculousfish
671df14178 Thread a parser into inputter_t 2019-06-02 16:41:13 -07:00
ridiculousfish
a48dbf23b8 Instantize the character event queue
Wrap this stuff up in structs so it's no longer global.
2019-06-02 16:37:05 -07:00
Fabian Homborg
6c1d29e14d fixup! Fix build
I deleted the lines that defined "narrow_path" and
"explicit_vars_path", but didn't see the two remaining uses.

Sorry!
2019-06-01 10:32:30 +02:00
Fabian Homborg
7525befadb path_get_path: Narrow string before
This cuts down on the wcs2string here by ~25%.

The better solution would be to cache narrow versions of $PATH, since
we compute that over and over and over and over again, while it rarely changes.

Or we could add a full path-cache (where which command is), but that's
much harder to invalidate.

See #5905.
2019-06-01 09:57:18 +02:00
Fabian Homborg
5ca14904d0 Store narrow version of uvar path
This sets the explicit path to the default one, which should be okay,
since the default path never changes (not even if $XDG_CONFIG_HOME
does).

Then it saves a narrow version of that, which saves most of the time
needed to `sync` in most cases.

Fixes #5905.
2019-06-01 09:56:57 +02:00
Fabian Homborg
bc19647be2 wutil: Give narrow versions of a few functions
Note that this isn't technically *w*util, but the differences between
the functions are basically just whether they do the wcs2string
themselves or not.
2019-06-01 09:34:47 +02:00
ridiculousfish
4e03d3c264 Correct a race in topic monitor
This fixes a race condition in the topic monitor. A thread may decide to
enter the wait queue, but before it does the generation list changes, and
so our thread will wait forever, resulting in a hang.

It also simplifies the implementation of the topic monitor considerably;
on reflection the whole "metagen" thing isn't providing any value and we
should just compare generations directly.

In the new design, we have a lock-protected list of current generations,
along with a boolean as to whether someone is reading from the pipe. The
reader (only one at a time) is responsible for broadcasting notifications
via a condition variable.
2019-05-31 09:31:42 -07:00
ridiculousfish
d920a618de Add FLOG logging to the topic monitor 2019-05-31 09:31:42 -07:00
ridiculousfish
b20bdcebfa FLOG narrow-string output to use fwprintf
This avoids mixing narrow and wide I/O on the same stream.
Extends the fix in #5900 by allowing narrow string literals again.
2019-05-31 09:31:42 -07:00
Fabian Homborg
f9f30e6a8e completions/rsync: Fix "=THING"
This included stuff like `--max-size=SIZE`. Weird that nobody noticed?

[ci skip]
2019-05-30 21:41:58 +02:00
Fabian Homborg
cd2b1b99e8 completions/rpm: Complete files for -qf
Fixes #5127.

[ci skip]
2019-05-30 19:27:41 +02:00
Fabian Homborg
77be5b05c6 CHANGELOG complete -F
[ci skip]
2019-05-30 19:20:15 +02:00
Fabian Homborg
df6f3fdcf4 completions/pacman: Fix pacman -Qo
(also yaourt)

[ci skip]
2019-05-30 19:20:06 +02:00
Fabian Homborg
430b2a48a9 completions/sudo: Fix sudo -e
This uses the new "--force-files" flag.

Fixes #5646.

[ci skip]
2019-05-30 19:14:33 +02:00
Fabian Homborg
4ebb6cf39e complete: Add "--force-files"
This allows a completion to specify that *it* takes files.

Useful for things like `sudo -e`, because sudo usually doesn't take
any files.
2019-05-30 19:13:42 +02:00
Fabian Homborg
d28e8fb7de ISSUE_TEMPLATE: Remove regression question
3.x has changed enough that knowing whether it's working in 2.7.x
doesn't help all that much anymore.

There've been 3222 commits since 2.7.1, which is about a third of the
commits to fish *total*.

[ci skip]
2019-05-30 18:49:50 +02:00
Fabian Homborg
87971e1f2e Widen the rest of the FLOGs
Fixes #5900.
2019-05-30 13:08:35 +02:00
Fabian Homborg
d73ee4d54b More using FLOGF when formatting is needed
sed-patched, every time a "%" is used in a call to `FLOG`, we use
`FLOGF` instead.
2019-05-30 11:54:09 +02:00
Fabian Homborg
9d62d8e3fd Use FLOGF when formatting is needed
This passed a format string in a variable which is why it was
presumably overlooked.

[ci skip]
2019-05-30 11:48:56 +02:00
ridiculousfish
ee9e5d4996 Allow disabling debug categories with leading -
This was always supposed to work but the string_prefixes_string call
had the wrong order.
2019-05-29 14:21:50 -07:00
ridiculousfish
0863c237b0 Make thread_id a visible thing
Every thread now has a non-recyclable thread id. This will be an aid in
debugging.
2019-05-29 12:34:11 -07:00
ridiculousfish
f3ee6a99c3 Add some FLOG logging around internal processes 2019-05-29 12:34:11 -07:00
Fabian Homborg
61292b0c6c fish_tests: Fix warnings 2019-05-29 21:11:08 +02:00
Fabian Homborg
a75155fd71 Disable strict-aliasing warning
This blows up the output on travis, so it's *worse than useless*.
2019-05-29 21:09:55 +02:00
Fabian Homborg
b574f3fb8f Turn off implicit fallthrough harder
On Travis:

>g++: error: unrecognized command line option ‘-Wimplicit-fallthrough=0’
2019-05-29 20:53:50 +02:00
Fabian Homborg
80afda08d5 cmake: Enable -Wall -Wextra
Not -Werror, just the warnings themselves.

Let's just see what happens. It's warning-free on my system.

Worst case we disable it again, better case we refine the set.
2019-05-29 20:50:35 +02:00
Fabian Homborg
6617c4d79e Use C++11 value-initialization instead of { 0 }
Removes a warning in GCC.
2019-05-29 20:50:35 +02:00
Fabian Homborg
1259b32ecc Mark some variables as unused
These triggered warnings.
2019-05-29 20:50:35 +02:00
Fabian Homborg
39099ceb10 Remove R_BEGIN_INPUT_FUNCTIONS
The enum starts at 0 (defined to be!), so we can eliminate this one.

That allows us to remove a reliance on the position of
beginning_of_line, and it would trigger a "type-limits" warning.

Also leave a comment because I actually hit that.
2019-05-29 20:50:35 +02:00
Fabian Homborg
4a6a354675 Placate compiler warnings 2019-05-29 20:50:35 +02:00
Fabian Homborg
364bc3fd63 test: Fix return type
This just returns a success signifier, not an error code.
2019-05-29 20:50:35 +02:00
Fabian Homborg
a5b633d3a5 env: Correct type
We'd be comparing "int" and "mode_t", and "mode_t" might be unsigned.

Found via GCC warning.
2019-05-29 20:50:35 +02:00
Fabian Homborg
e895cef245 tinyexpr: Correct pi type 2019-05-29 20:50:35 +02:00
David Adam
78d015bd61 string: add tests for empty capture groups
As seen in #5201.
2019-05-29 23:14:19 +08:00
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
Fabian Homborg
d0921489ee fish_git_prompt: Fix changing show_informative_status
If you changed $__fish_git_prompt_show_informative_status, it
triggered a variable handler, which erased the chars, but neglected to
unset $___fish_git_prompt_init, so we just kept chugging along with
empty characters.

What's the hardest thing in CS again? Cache something something?

[ci skip]
2019-05-29 10:36:14 +02:00
Fabian Homborg
66e238fad0 More wide IO for FLOG
This widens the remaining ones that don't take a char
anywhere.

The rest either use a char _variable_ or __FUNCTION__, which from my
reading is narrow and needs to be widened manually. I've been unable
to test it, though.

See #5900.
2019-05-29 08:07:04 +02:00
Fabian Homborg
32949eefbe src/exec: Use wide IO for FLOG
Another step towards #5900.
2019-05-28 23:08:35 +02:00
Fabian Homborg
6d66c47f70 completions/fish: Add FLOG additions
[ci skip]
2019-05-28 22:43:37 +02:00
Fabian Homborg
7c1a40fe86 flog: Use wide literals with wide chars
This solves the main part of (careful linebreak)
issue #5900.

I'm betting all the errors that do use narrow IO are broken, including
a bunch of asserts.
2019-05-28 22:39:47 +02:00
Fabian Homborg
7086ba43c8 CHANGELOG: Arbitrarily reorder notable fixes
This is roughly in order of importance.

Buffering is really quite nice, $pipestatus is a new thing, $PATH was
a big hubhub, people seem to like eval...

[ci skip]
2019-05-28 22:28:45 +02:00
Fabian Homborg
1e9ec8739b CHANGELOG: Clarify message about parser errors, fix commit
3e055f does not exist. I'm assuming it's
b2a1da602f.

Unfortunately, I'm not entirely sure what kind of parser errors
weren't propagated, so this note isn't all that useful.

[ci skip]
2019-05-28 22:24:47 +02:00
David Adam
7fe93c7518 src/expand: update comment for fallthrough to GCC standard
As suggested in 75db3b4ff4 (r33153119)
2019-05-28 23:20:20 +08:00
David Adam
b5cf9e52ca wcsfilecmp: be clearer about sorting "-" after letters 2019-05-28 22:05:23 +08:00
David Adam
c848787107 add extra test for wcsfilecmp
Test changes added for #5634 in 6e525cc5d9.
2019-05-28 22:03:03 +08:00
David Adam
ba4f4bfce2 Convert further debug(0) calls to FLOG
Follow on from ea9d1ad82f.
2019-05-28 21:06:42 +08:00
ridiculousfish
29c627d020 Stop calling principal_parser() inside parse_execution.cpp 2019-05-27 19:56:35 -07:00
ridiculousfish
835c6ffa67 clang-format all files 2019-05-27 19:47:13 -07:00
ridiculousfish
b9ef8797f1 Merge branch 'flog'
This merges support for FLOG, a replacement for debug().

Fixes #5879
2019-05-27 18:20:22 -07:00
ridiculousfish
0150d505de Allow underscores to be treated as dashes in debug categories 2019-05-27 17:38:09 -07:00
ridiculousfish
ea9d1ad82f Convert debug(0) calls to FLOG 2019-05-27 17:31:17 -07:00
ridiculousfish
6282ac5713 Convert locale variable changes from debug to flog 2019-05-27 17:24:52 -07:00
ridiculousfish
46a9da83e8 Convert terminal ownership logging from debug to flog 2019-05-27 17:24:52 -07:00
ridiculousfish
d9676bb2a8 Convert fork events from debug to flog 2019-05-27 17:24:52 -07:00
ridiculousfish
8774860468 Convert job logging from debug to FLOG 2019-05-27 17:24:52 -07: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
ridiculousfish
b405b979ec Eliminate the CHECK() macro
This thing was pretty useless.
2019-05-27 17:24:19 -07:00
Fabian Homborg
8c76bb49a4 Turns out order in the tests matters
This is a bit embarassing, sorry!
2019-05-27 23:22:28 +02:00
Fabian Homborg
4710df37d1 tests: Add two new directories
These are now matched because we now use fuzzy matching.
2019-05-27 23:20:28 +02:00
Fabian Homborg
d46dacdfee Stop abusing __fish_complete_suffix to complete dirs
[ci skip]
2019-05-27 19:37:28 +02:00
Fabian Homborg
dcf017ff57 fish_complete_directories: Use complete -C
This way we use our core file completion code, which is much more
flexible than we can easily achieve directly in script (which would
require e.g. an `expand` builtin, and case-insensitive globs).

Fixes #5896.
2019-05-27 19:33:52 +02:00
Fabian Homborg
9ae3b345c8 Handle empty strings in compare_completions_by_tilde
Fixes #5895.
2019-05-27 08:17:05 +02:00
ridiculousfish
d5f2d472d0 Thread a parser into reader
Eliminates uses of principal_parser
2019-05-26 18:51:47 -07:00
ridiculousfish
7ed1022cf4 Latch signal handlers
Now that our interactive signal handlers are a strict superset of
non-interactive ones, there is no reason to "reset" signals or take action
when becoming non-interactive. Clean up how signal handlers get installed.
2019-05-26 18:04:03 -07:00
ridiculousfish
ead7f28026 Unify the SIGQUIT handlers and remove set_non_interactive_handlers
Interactive signal handlers are now a strict superset of non-interactive
ones. Remove set_non_interactive_handlers()
2019-05-26 13:18:06 -07:00
ridiculousfish
d729d57d94 Unify the interactive and non-interactive signal handlers
The signal handlers for interactive and non-interactive SIGINT were distinct
and talked to the reader. This wasn't really justified and will complicate
having multiple threads. Unify these into a single signal handler.
2019-05-26 00:32:11 -07:00
ridiculousfish
5a4df9dd3a Use sigint_checker_t in debug_thread_error 2019-05-25 19:19:03 -07:00
ridiculousfish
ea3ad0c099 Introduce sigint_checker_t and use it in wait
Allow a simpler way to check for sigint via sigint_checker_t.
Adopt it in builtin_wait, instead of hooking into the reader.
2019-05-25 19:08:04 -07:00
ridiculousfish
f8ba0ac5bf Remove is_interactive_read
is_interactive_read is a suspicious flag which prevents a call to
parser_t::skip_all_blocks from a ^C signal handler. However we end
up skipping the blocks later when we exit the read loop.

This flag seems unnecessary. Bravely remove it.
2019-05-25 18:46:03 -07:00
ridiculousfish
2924751488 Correct priority of universal and global variable setting
When setting a variable without a specified scope, we should give priority
to an existing local or global above an existing universal variable with
the same name.

In 16fd780484 there was a regression that
made universal variables have priority.

Fixes #5883
2019-05-25 17:35:19 -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
e339e0f389 fish_indent: Fix pygments 2019-05-25 11:38:05 +02:00
Fabian Homborg
6c0ae7477e reader: Only abort history search on cancel
Otherwise we'd undo the history search when you press e.g. execute,
which means you'd execute the search term.

Only `cancel` should walk it back, like it previously did hardcoded to
escape.

Fixes #5891.
2019-05-25 08:32:50 +02:00
ridiculousfish
a5a5ccb73d Revert "exec: If a job includes a builtin, it stays in our pgroup"
This reverts commit 711260593c.

This ended up breaking the tests; moreover it may have other problems
like preventing backgrounding.

Reopens #5855
2019-05-24 18:00:31 -07:00
ridiculousfish
c79c92eb47 Fix fish_indent tests 2019-05-24 17:00:56 -07:00
ridiculousfish
43e3d3bcf2 Fix the argparse tests 2019-05-24 16:51:40 -07:00
ridiculousfish
a379e9ffeb Make the expect tests run again
These were inadvertently disabled by a bug which was introduced in
cd7e8f4103 . Fix the bug so the tests run
again.

They don't all pass yet; they regressed during the period they were
disabled.
2019-05-24 16:10:44 -07: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
1fd627ebd3 reader: Don't handle escape specially
Escape is just another ordinary character that you can bind, or not.
2019-05-24 19:02:53 +02:00
Fabian Homborg
dd4e0a3b6d Actually end history search
Fixes #5818.
2019-05-24 19:01:24 +02:00
Fabian Homborg
d0bd238657 Don't hardcode enum numbers
"1" in the context of `escape_string(..., 1)` is referring to
`ESCAPE_ALL`, so we should use that.
2019-05-24 18:19:11 +02:00
Fabian Homborg
711260593c exec: If a job includes a builtin, it stays in our pgroup
Fixes #5855.
2019-05-24 18:04:20 +02:00
Fabian Homborg
f2bb1c8c1f expand: Simplify expand_escape_variable 2019-05-24 17:03:43 +02:00
ridiculousfish
84febe8f2e Make disowned pid reaping thread-safe 2019-05-22 17:10:33 -07:00
ridiculousfish
4d929720ce Clean up and rename io_transmorgrify 2019-05-22 16:36:22 -07:00
ridiculousfish
7915831939 Wrap setenv() and unsetenv() calls in a lock 2019-05-22 16:13:31 -07:00
ridiculousfish
e91d68266c Eliminate reader_current_filename
Store this in the parser libdata instead.
2019-05-22 13:51:27 -07:00
ridiculousfish
686b84396c Migrate the return bool outside of block_t
This is a flag that gets set by the return function. But we only need one,
not per-block. Move it into libdata.
2019-05-22 13:51:27 -07:00
Fabian Homborg
9a541d9ed4 expand: Use wcstring for the abbr prefix
This mainly is conceptually a bit simpler. The comment about making it
cheaper is entirely misplaced since this is quite far away from being
important.

Even expanding 1000 abbrs, it doesn't show up in the profile.
2019-05-22 22:31:45 +02:00
Fabian Homborg
212246ecaa fish_indent: Fix reading from stdin for 0 args
I have no idea why this passes the tests, we *have* tests reading from
stdin!
2019-05-22 22:21:28 +02:00
Fabian Homborg
1faffa515e Don't crash if CDPATH is "./"
Fixes #5887.
2019-05-22 21:48:40 +02:00
ridiculousfish
363652ad76 debug_thread_error to wait for a signal instead of sleep
Allows for control-C out of it
2019-05-21 20:15:59 -07:00
Fabian Homborg
6d20b3984a Revert "src/screen: Stop falling back to wchar_t"
This was, under some circumstances, apparently off by one.

If a suggestion was really long, like

```fish
infocmp | string split , | string trim | string match -re . | while read -d = -l key val; test -z "$val"; and continue; string match -q '*%*' -- $val; and continue; test (string replace -ra '\e([\[\]]|\(B).*[\comJKsu]' '' -- a(tput $key)b) = ab; or echo $key $val; end > xterm
```

(I'm assuming longer than $COLUMNS), it would staircase like with a wrong wcwidth.

This reverts commit 15a5c0ed5f.
2019-05-21 23:35:31 +02:00
ridiculousfish
11209b7553 Switch the block stack to a deque instead of vector of shared pointers
That makes the block stack easier to copy.
2019-05-21 10:25:48 -07:00
ridiculousfish
ad57133c7f Switch parser_t to hold its variables via shared_ptr
Preparation for variable stacks with finite lifetimes.
2019-05-21 10:25:48 -07:00
Fabian Homborg
261198aa3e completions/set: Complete some config vars even if they aren't set
Fixes #5884.

[ci skip]
2019-05-21 17:00:32 +02:00
Aaron Gyes
714b8420a9 %s -> %ls for wchar_t
I noticed my debug output for 24bit color mode was garbled due to
this being wrong. I spent a little time trying to get the compiler
to tell us about these, but -Wformat doesn't do anything for wchar
printf functions, and __attribute__((format(printf, n, m))) will
cause an error with wchar_t's, so I gave up and decided to manually
check out every '%s' in the entire project. I found (only) one
more.

debug(0, "%s", wchars) will report warnings for incorrect
specifiers but debug(0, L"%s", wchars) is unable. Thus there may
be reason to prefer not using L"..." as an argument if all else
is equal and it's not necessary.
2019-05-20 13:48:35 -07:00
Fabian Homborg
7ddae68645 Restyle a few stragglers
THERE WERE TABS! TABS!

TABS!

[ci skip]
2019-05-20 21:07:37 +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
ridiculousfish
8e640cdcc5 fish_indent to stop stripping quotes from keywords 2019-05-19 20:56:28 -07:00
ridiculousfish
159d6d669a Remove all block_t subclasses 2019-05-19 14:44:40 -07:00
ridiculousfish
eff4873eca Stop creating subclasses of block_t
Move all block_t creation methods to static methods, and stop creating
subclasses (all of which are now empty).
2019-05-19 14:40:35 -07:00
ridiculousfish
cf92b7626c Migrate event_block's event into block_t 2019-05-19 13:07:06 -07:00
ridiculousfish
8697fa063b Migrate source_block's source_file into block_t
Continue to work towards flattening this hierarchy.
2019-05-19 13:01:59 -07:00
ridiculousfish
fec0e40b5e Migrate function_block name and args into block_t
The goal is to eliminate this block hierarchy.
2019-05-19 12:56:07 -07:00
ridiculousfish
cd7e8f4103 Migrate loop status from blocks into libdata
Blocks will soon need to be shared across parsers. Migrate the loop status
(like break or continue) from the block into the libdata. It turns out we
only ever need one, we don't need to track this per-block.

Make it an enum class.
2019-05-19 12:50:05 -07:00
Fabian Homborg
ff3fe961f4 Add pipeline.expect to flakey tests
This one fails on Travis sometimes, but I've not been able to
reproduce on a real machine.
2019-05-19 20:59:03 +02:00
Fabian Homborg
257c72d8be Document string split superpowers more
[ci skip]
2019-05-19 19:40:48 +02:00
Fabian Homborg
3efa2ad93b Replace wcslen with math 2019-05-19 18:23:33 +02:00
Fabian Homborg
1e9d41f2c1 Remove now-useless code for detecting {}
This can't happen anymore.
2019-05-19 18:23:33 +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
15a5c0ed5f src/screen: Stop falling back to wchar_t
wcstring is perfectly capable of doing this.
2019-05-19 17:32:09 +02:00
Dawid Dziurla
0b3bb0e7c1 Underline every valid entered path (#5872)
* src/highlight: Underline every valid entered path

* update CHANGELOG

* fix highlight test
2019-05-19 10:03:56 +02:00
ridiculousfish
c42eb0eb4f Remove the process from function_block_t
Prior to this fix, a function_block stored a process_t, which was only used
when printing backtraces. Switch this to an array of arguments, and make
various other cleanups around null terminated argument arrays.
2019-05-18 21:09:04 -07:00
ridiculousfish
508c3a8005 Make is_event and other globals part of parser_t libdata 2019-05-18 19:03:45 -07:00
ridiculousfish
c44dae2d73 Migrate certain runtime flags to atomics hidden behind functions 2019-05-18 18:50:28 -07:00
ridiculousfish
4fcb9d1fed Hide no_exec behind a function 2019-05-18 18:50:28 -07:00
ridiculousfish
be41407610 Make have_proc_stat an ordinary function
Removes a mutable global variable.
2019-05-18 18:50:28 -07:00
ridiculousfish
5158ee812b Eliminate the job from block_t
This exists only to support the '--on-job-exit caller' feature.
Just store the calling job ID directly in the parser's libdata.
2019-05-18 18:50:28 -07: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
ridiculousfish
005e6f2ab8 Revert "Don't service ioport completions if data is available on stdin"
This reverts commit 0453023f7b.

This broke the history tests. Reverting this while I sort it out.
2019-05-14 09:52:49 -07:00
Fabian Homborg
a7b1c2f76a Drop wcwidth ASCII check
Updated widechar_width takes care of it.

Technically, this does ~3 comparisons more per-character (because it
checks variation selectors and such), but that shouldn't really matter.
2019-05-14 09:49:51 +02:00
Fabian Homborg
2d37bc9bd1 Update widechar_width
This includes the change to check ASCII chars first, so we can now
drop our workaround.
2019-05-14 09:49:51 +02:00
Fabian Homborg
752b5362ee Only widen string if necessary
This tried a bunch of times, but only the final one is important.
2019-05-14 09:49:51 +02:00
Fabian Homborg
87b93cd4ca src/history: Only widen bash history lines once
This did str2wcs when checking, then again when adding.
2019-05-14 09:49:51 +02:00
Fabian Homborg
2aaf7fda27 src/history: Stop renarrowing a string in a for-loop
Classic case of doing stuff in a loop that doesn't change. No idea if
the compiler caught it, but I sleep easier now.
2019-05-14 09:49:50 +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
ridiculousfish
0453023f7b Don't service ioport completions if data is available on stdin
This defers certain autosuggestions and syntax highlighting until after
large pastes are complete.
2019-05-13 14:16:43 -07:00
ridiculousfish
277db64804 Force termsize back to valid in get_current_winsize()
get_current_winsize() is intended to be lazy. It does the following:

1. Gets the termsize from the kernel
2. Compares it against the current value
3. If changed, sets COLUMNS and LINES variables

Upon setting these variables, we notice that the termsize has changed
and invalidate the termsize. Thus we were doing this work multiple times
on every screen repaint.

Put back an old hack that just marked the termsize as valid at the end
of get_current_winsize().
2019-05-13 14:05:42 -07:00
Fabian Homborg
e22422c073 Don't do fish_setlocale that early
This just sets some special characters that we use in the reader, so
it only needs to be done before the reader is set up.

Which, as it stands, is in env_init().
2019-05-13 16:09:37 +02:00
ridiculousfish
234c97e6d2 Remove some unused variables 2019-05-12 18:23:00 -07:00
ridiculousfish
1719d6f136 Make $status and $pipestatus per-parser
Another step towards allowing multiple parsers to execute in parallel.
2019-05-12 14:00:44 -07:00
ridiculousfish
8031fa3bdb Stop using atomic types for non-primitives
atomic<winsize> requires linking libatomic on some platforms which is
annoying. Remove the one use.

Fixes #5865
2019-05-12 13:07:37 -07:00
ridiculousfish
3d25ce1fd4 Merge remote-tracking branch 'takoyaki/ant_completion' into master 2019-05-11 23:22:45 -07:00
ridiculousfish
1e4ebfa470 Make electric variables a real thing
Use an actual struct to describe electric variables and what is special
about each one.
2019-05-11 19:17:33 -07:00
ridiculousfish
16fd780484 Reimplement the whole variable stack
The variable stack is a mess - confused locking, surprising callouts, and
unclear division of labor. Just reimplement the whole thing.
2019-05-11 19:17:16 -07:00
ridiculousfish
cfddd881ef Make PWD a per-processor variable
Handle this variable specially.
2019-05-11 17:13:34 -07:00
ridiculousfish
ee250aba82 Factor some environment setting into set_scoped_internal
Breaks up a monolith function.
2019-05-11 17:13:34 -07:00
ridiculousfish
15a52d0f0d Centralize some of the logic for walking the environment stack
Prepare to introduce a new node for per-process variables.
2019-05-11 17:13:34 -07:00
Fabian Homborg
adcc70d0b3 wcwidth: Return early for simple ASCII
Characters from space to before DEL are width 1, and they
appear *often*.

So it's quite a good idea to return early for them.

Fixes #5866.
2019-05-11 21:40:35 +02:00
Fabian Homborg
c27c8801af completions/git: Put local branches before unique remotes
With a few remotes, unique remote branches can get quite large, and
you probably mostly work on your own.

[ci skip]
2019-05-11 12:43:05 +02:00
Fabian Homborg
816df47c10 fish_clipboard_paste: Only trim leading whitespace on first line
We remove leading spaces so a paste isn't histignored, but we did so
on all lines, which removed indentation.

[ci skip]
2019-05-11 11:19:21 +02:00
Fabian Homborg
4462f6d600 src/screen: Skip a wcswidth
This stops trying to see if the previous line is wider if it is a
prefix of the current one.

Which turns out to be true often enough that it's a net benefit.
2019-05-11 10:43:38 +02:00
Fabian Homborg
ac983f6c4b src/screen: Stop recomputing wcwidth
This passes character width as an argument for a few functions.

In particular, it hardcodes a width of "1" for a space literal.
There's no reason to compute wcwidth for the length of the prompt.
2019-05-11 10:43:38 +02:00
Fabian Homborg
567b6ed2b5 src/screen: Stop doing a bunch of unnecessary work
This measured *all* the characters on the commandline, and saved all
of them in another wcstring_list_t, just to then do... nothing with
that info.

Also, it did wcslen for something that we already have as wcstring,
reserved a vector and did a bunch of work for autosuggestions that
isn't necessary if we have more than one line.

Instead, we do what we need, which is to figure out if we are
multiline and how wide the first line is.

Fixes #5866.
2019-05-10 17:43:46 +02:00
Fabian Homborg
d2b02a8a61 src/screen: Only check for combining marks if necessary
line_shared_prefix explains in its comment that

> If the prefix ends on a combining character, do not include the
  previous character in the prefix.

But that's not what it does.

Instead, what it appears to do is to return idx for *every* combining
mark. This seems wrong to begin with, and it also requires checking
wcwidth for *every* character.

So instead we don't do that. If we find the mismatch, we check if it's
a combining mark, and then go back to the previous character (i.e. the
one before the one that the combining mark is for).

My tests found no issues with this, other than a 20% reduction in
pasting time.
2019-05-10 17:43:46 +02:00
Fabian Homborg
eb41965ac3 reader: Remove superfluous while-loop
It's possible this was useful at some point, but now it just always
inserts the string the first time.
2019-05-10 17:43:46 +02: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
50ed5126f1 completions/git: Reorder some completions with --keep-order
They are displayed in LIFO-order, so it makes sense to e.g. put the
recent commits close to last (only before files) for `checkout`.

Fixes #5868.
2019-05-10 15:36:41 +02:00
Mahmoud Al-Qudsi
097d6c3c5b Fix order of operations in tilde comparison
The previous form of the statement evaluated to a constant comparison
and couldn't have been what was actually intended.
2019-05-09 01:22:23 -05:00
Per Bothner
4c0a119557 Disable cursor_down optimization, but fix to check c_oflag, but c_iflag.
The old commit #3f820f0 "Disable ONLCR mapping of NL output to CR-NL"
incorrectly used c_iflag instead of c_oflag, and I copied that error
in my patch.  Fixed that. However, there seems to be other problems
trying to use "\x1B[A", which I have not tried to debug, so comment that out.

(However, #3f820f0 seems to mostly work if we fix it to use c_oflag.)
2019-05-08 17:22:44 +02:00
Per Bothner
50db10a422 Alternate fix for cursor_down bound to "\n" and ONLCR set.
See GitHub issue #4505 "Terminal mode confusion"
and commit #3f820f0 "Disable ONLCR mapping of NL output to CR-NL".
2019-05-08 17:22:44 +02:00
Fabian Homborg
e20c08d04e argparse: Fix validation for short-only-flags
This read something like `o=!_validate_int`, and the flag modifier
reading kept the pointer after the `!`, so it created a long flag
called `_validate_int`, which meant it would not only error out form

```fish
argparse 'i=!_validate_int' 'o=!_validate_int' -- $argv
```

with "Long flag '_validate_int' already defined", but also set
$_flag_validate_int.

Fixes #5864.
2019-05-06 17:24:42 +02:00
Fabian Homborg
5bf21f2928 Penalize files ending in ~ in suggestions
Fixes #985.
2019-05-06 17:07:29 +02:00
Fabian Homborg
cc205a134b Disable fish_title in emacs 2019-05-06 17:06:40 +02:00
ridiculousfish
8a8b2513b5 Eliminate the global jobs() function
All job lists are attached to a parser now.
2019-05-05 11:33:08 -07:00
Fabian Homborg
afff93bdb2 Disable vi-cursor in tests
Otherwise this breaks if run inside a terminal that could do the cursor.
2019-05-05 17:31:33 +02:00
Fabian Homborg
8f3f4bbc9c CHANGELOG fish_indent semicolons and test stacktrace
[ci skip]
2019-05-05 15:22:01 +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
d83636f70e completions/git: Handle AD files
Added files that were deleted after. These count as both added and
deleted.

Fixes #5861.

[ci skip]
2019-05-05 13:49:11 +02:00
Fabian Homborg
bcce6d691f Keep "; and" and "; or" on fish files
This reformats *.fish files from before commit
c2970f9618 with the changes to fish_indent.

[ci skip]
2019-05-05 13:34:38 +02:00
Fabian Homborg
46b804cf19 fish_vi_cursor: Don't fail if --force-iterm is given in non-iterm
Otherwise this would have used it as the terminal.

Fixup!

[ci skip]
2019-05-05 13:05:19 +02:00
Fabian Homborg
e952f60b02 functions/fish_vi_cursor: Disable on iTerm, allow override
I still don't get #3696, so let's just offer an override for now.

[ci skip]
2019-05-05 13:01:02 +02:00
Fabian Homborg
7451443050 functions/fish_vi_cursor: Cleanup
Removes the unused "uses_echo" variable and adds some comments.

[ci skip]
2019-05-05 12:57:14 +02:00
Fabian Homborg
7d2eb9649c functions/fish_vi_cursor: Detect a few more terms
These have $TERM entries of their own, so detecting them is quite easy.
2019-05-05 12:57:14 +02:00
Fabian Homborg
c22af0d8c7 functions/fish_vi_cursor: Simplify detection
This was quite famously rather complicated.

We drop a bunch of cases - we can't handle tmux-starting-terminals
100% accurately, so we just don't try. It should be quite rare that
somebody starts a different terminal from tmux.

We drop the `tput` since it is useless (like terminfo in general for
feature-detection, because everyone claims to be xterm).

So we just check if we are in konsole, iTerm, vte or genuine-xterm.

Fixes #3696.

See #3481.
2019-05-05 12:57:14 +02:00
Fabian Homborg
787ef3e558 functions/fish_vi_cursor: Move $XTERM_VERSION check earlier
Saves us from having to do it again and again.
2019-05-05 12:56:31 +02:00
Fabian Homborg
4078a3df26 build_tools/style.fish: Stop excluding completions
[ci skip]
2019-05-05 12:54:02 +02:00
Fabian Homborg
ce245704d7 Reformat completion scripts
These were excluded from style.fish
2019-05-05 12:53:09 +02:00
Fabian Homborg
15c50703ce fish_indent: Allow semicolons for and and or
As mentioned in #2900, something like

```fish
test -n "$var"; and set -l foo $var
```

is sufficiently idiomatic that it should be allowable.

Also fixes some additional weirdness with semicolons.
2019-05-05 12:51:49 +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
90d64194c5 functions: Replace crummy forced tab with spaces
Still forced indentation, but at least the kind we recommend via
fish_indent.

Fixes #1472.
2019-05-05 12:07:38 +02:00
Fabian Homborg
df7cb66ff9 build_tools/style: Make output a bit spicier.
COLORS! ALL THE COLORS! Well, three! No, wait, FOUR! But only if you
count "normal" as a color!

[ci skip]
2019-05-05 12:07:38 +02:00
Fabian Homborg
2b3f48d9ee build_tools/style.fish: Use black as python formatter
(Also renames the silly "$f_files" to "$fish_files")
2019-05-05 12:07:38 +02:00
Fabian Homborg
3bea947bb5 fish_indent: Ignore consecutive semicolons
This removes semicolons at the end of the line and collapses
consecutive ones, while replacing meaningful semicolons with newlines.

I.e.

```fish
echo;
```

becomes

```fish
echo
```

but

```fish
echo; echo
```

becomes

```fish
echo
echo
```

Fixes #5859.
2019-05-05 12:07:38 +02:00
Deniz Kızılırmak
c7cbf6dad0 Make 'git checkout' complete recent commits 2019-05-05 11:52:18 +02:00
ridiculousfish
1e171140d5 Make the input_common lookahead main-thread only 2019-05-04 20:58:36 -07:00
ridiculousfish
9018a7d5ee Rename input_initialized to s_input_initialized and make it relaxed atomic 2019-05-04 20:58:35 -07:00
ridiculousfish
e10838d5d6 Make job_control_mode a static variable with accessors 2019-05-04 20:58:35 -07:00
ridiculousfish
9fb98baba6 Thread the parser into process_clean_after_marking 2019-05-04 20:58:35 -07:00
ridiculousfish
32d1b3d7cb Simplify looping in readb 2019-05-04 20:58:35 -07:00
ridiculousfish
edab366d3a Eliminate the "input callback queue"
This was a sort of side channel that was only used to propagate redraws
after universal variable changes. We can eliminate it and handle these
more directly.
2019-05-04 20:58:35 -07:00
ridiculousfish
56fd6f696b Improve thread safety in input.cpp 2019-05-04 20:58:35 -07:00
ridiculousfish
36998eee55 Make more miscellaneous globals thread safe 2019-05-04 20:58:35 -07:00
ridiculousfish
e2c66a8131 Make termsize thread safe 2019-05-04 20:58:35 -07:00
ridiculousfish
0de1611bf1 Migrate builtin_complete recursion_level into parser_t::libdata 2019-05-04 20:58:35 -07:00
ridiculousfish
2ce827343e Universal variables to become a latch variable 2019-05-04 20:58:35 -07:00
ridiculousfish
b0a695e9fa Migrate the global exec_count into the parser 2019-05-04 20:58:35 -07:00
ridiculousfish
fe68287cb0 Make miscellaneous variables thread-safe 2019-05-04 20:58:35 -07:00
ridiculousfish
6e143bf50f Eliminate history_collection_t
This was a pretty useless type.
2019-05-04 20:58:35 -07:00
ridiculousfish
3d63a68dd0 Make builtin_random thread safe 2019-05-04 20:58:35 -07:00
ridiculousfish
f66e010949 Turn a lot of common.h variables into getter functions
Improves thread safety.
2019-05-04 20:58:35 -07:00
ridiculousfish
9dc1fd50c9 Introduce global_safety.h
This is a set of types that enable characterizing the proper way to access
global variables.
2019-05-04 20:53:32 -07:00
ridiculousfish
ec522e5978 Migrate s_main_thread_request_queue to owning_lock 2019-05-04 20:42:56 -07:00
ridiculousfish
18cecd3663 Beef up find_globals
Allow it to find the source declarations for globals, and ignore const ones.
2019-05-04 20:42:48 -07:00
ridiculousfish
1e57424011 Thread a parser into function_exists
Since this may autoload, it needs a parser with which to autoload.
2019-05-04 20:20:52 -07:00
ridiculousfish
bffacd2fbf Thread a parser into expansion
Expansion may perform command substitution, which needs to know the parser
to use.
2019-05-04 19:30:00 -07:00
ridiculousfish
4ce485525e Correct duplicate completion detection
Stop assuming that completions with the same hash are equal.
2019-05-04 18:35:22 -07:00
ridiculousfish
923a7ca0f0 Thread the parser into complete()
Eliminates uses of principal_parser
2019-05-04 18:17:18 -07:00
ridiculousfish
63bdc949ab Make completion request flags an enum_set 2019-05-04 17:55:57 -07:00
ridiculousfish
acd33cbabb Remove an unnecessary fetch of the principal parser 2019-05-04 16:56:38 -07:00
ridiculousfish
fbd4ff027a Initialize a field that was previously uninitialized
Caught by UBSan
2019-05-04 16:47:27 -07:00
ridiculousfish
c0c7b0f86f Make tsan detection gcc compatible 2019-05-04 16:13:55 -07:00
ridiculousfish
ec45f31ad1 Make debug_level an atomic
Fixes a tsan warning
2019-05-04 15:28:44 -07:00
ridiculousfish
0dd9f64bd9 Make topic monitor compatible with tsan
tsan does funny things to signals, preventing signals from being delivered
in a blocking read. Switch the topic monitor to non-blocking reads under
tsan.
2019-05-04 13:06:06 -07:00
Fabian Homborg
0784b76570 completions/env: Inhibit files
(Also remove annoying "commmand" description)

[ci skip]
2019-05-03 16:35:25 +02:00
Fabian Homborg
e91eb85949 argparse: Fix -- regression
I was a tad overzealous there with not appending the remaining
arguments.

Weird that we didn't test it, though.

Fixes #5857.
2019-05-03 16:20:40 +02:00
Fabian Homborg
411b4aea9d share/completions/env: Fix
This completed the commandline with options removed, which looked like

    env VAR=VAL command option

Which didn't really actually work.

Fixes #5856.

[ci skip]
2019-05-02 16:29:11 +02:00
ridiculousfish
649d3ac101 Simplify reporting of invalid config paths
Do this at a well defined point, instead of randomly the first time they're
queried.
2019-05-01 17:51:51 -07:00
ridiculousfish
72e43a514b Correct the warning for invalid directories
This was inadvertently broken.
2019-05-01 17:47:50 -07:00
ridiculousfish
55e3270ac4 Remove erase_list from process_clean_after_marking
We don't need to maintain an erase_list in this function any more.
Simply remove jobs that are completed.
2019-05-01 16:32:14 -07:00
ridiculousfish
3dfaa192da Put back process and job exit events
These were removed in f8b2e818ed under a
belief that they were unused. But they are documented and supported.
2019-05-01 16:32:14 -07:00
ridiculousfish
43d668bdc8 Continue to refactor internal loop of process_clean_after_marking
Factor our logic around when to print a message.
2019-05-01 16:32:14 -07:00
ridiculousfish
b5d3fadf44 Factor out the individual process handling in process_clean_after_marking
Helps break up this monolith.
2019-05-01 16:32:14 -07:00
ridiculousfish
b8170ec1ce Clarify return value of job_reap and process_clean_after_marking 2019-05-01 16:32:14 -07:00
ridiculousfish
9700800ecf Factor disowned job removal into its own function
This helps break up process_clean_after_marking.
2019-05-01 16:31:21 -07:00
ridiculousfish
c05e72749a Rename PENDING_REMOVAL to DISOWN_REQUESTED
A commend implied that PENDING_REMOVAL was broader than it was. In practice
only disown() sets this flag. Rename the flag for clarity.
2019-05-01 15:37:53 -07:00
Aaron Gyes
b5865d2cba Spruce up fish_config output, show transcript of commands run
run_fish_cmd() now prints every command we run in a subshell

Fixes #5584
2019-04-30 14:08:11 -07: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
3b532fc793 functions/fish_vi_key_bindings: Pass "-s" to shared bindings
Fixes #5853.

[ci skip]
2019-04-30 11:41:26 +02:00
David Adam
665ae3787a Switch to runtime check for /proc/self/stat
Removes a compile-time check that may have affected cross-compilation.

Work on #1067.
2019-04-30 16:23:28 +08: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
Wilke Schwiedop
95346770d3 Update emaint.fish 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
78e6631e53 formatting 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
05f79335cc completions/emerge: add verbose-conflicts 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
1b3643270d completions/epkginfo: add completion 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
d0c3a4f33f completions/equery: shorten descriptions 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
34f50883a4 completions/ebuild: add pretend command 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
52450dc864 completions/emaint: fix logs command 2019-04-29 18:33:37 +02:00
Fabian Homborg
389f5074ad Add test for argparse crash
43929ced9
2019-04-29 17:03:16 +02:00
Fabian Homborg
43929ced90 src/builtin_argparse: Work around wgetopt crash
If on the last argument, and it was an unrecognized option, we can't
call `wgetopt_long()` again, or it'll crash.
2019-04-29 16:55:55 +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
ridiculousfish
d8ac051f89 Move selection_direction_t to pager.h and make it a class enum 2019-04-28 14:06:03 -07:00
ridiculousfish
3c9f95594a Update Dockerfile for cmake3 2019-04-28 11:41:37 -07:00
ridiculousfish
2507162f80 Revert "Add a test for autoload_t"
This reverts commit 51c62d6cc6.

Back out the test while I attempt to fix it
2019-04-27 20:14:06 -07:00
ridiculousfish
51c62d6cc6 Add a test for autoload_t 2019-04-27 16:16:48 -07:00
ridiculousfish
4ff50eba41 Remove autoload_t, rename autoloader_t to autoload_t
Now that there are no more clients of autoload_t, delete it and
rename autoloader_t to autoload_t. Also clean up the headers.
2019-04-27 15:47:08 -07:00
ridiculousfish
68a28106b2 Reimplement completion autoloading via autoloader_t
This switches the completion autoloading machinery to autoloader_t.
2019-04-27 15:37:24 -07:00
ridiculousfish
960266fe24 Reimplement the function store and autoloading
This cleans up how functions are stored and autoloaded. It eliminates the
recursive lock. Instead there is a single normal owning_lock that protects
the entirety of the function data. Autoloading is re-implemented via the
new autoloader_t.
2019-04-27 15:30:11 -07:00
ridiculousfish
3950dab9ff Add autoloader_t
autoloader_t will be the reimplementation of autoloading. Crucically it no
longer manages any locking or loading itself; instead all locking and loading
is performed by clients. This makes it easier to test and helps limit its
responsibilities.
2019-04-27 15:26:18 -07:00
ridiculousfish
b7ad6b5bdc Add autoload_file_cache_t
This will provide the "backing store" for autoloading.
2019-04-27 15:09:24 -07:00
ridiculousfish
6ec7c50ace Stop removing functions and completions in autoload
autoloading has a "feature" where functions are removed in an LRU-fashion.
But there's hardly any benefit in removing autoloaded functions. Just stop
doing it.
2019-04-27 14:49:05 -07:00
ridiculousfish
7b44b5ef15 Titlecase LRU template parameters 2019-04-27 12:07:16 -07:00
ridiculousfish
f297543ca1 Make owning_lock's template parameter titlecase instead of uppercase 2019-04-27 12:04:36 -07: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
puenka
30f040ed36 Add speedtest-cli/speedtest completion (#5840)
* Add speedtest-cli/speedtest completion

Added a completion file for speedtest-cli utility (https://github.com/sivel/speedtest-cli) as shipped from various package repositories.

* added no-files parameter

* Remove inheritance to speedtest

* Create speedtest.fish
2019-04-27 09:34:28 +02:00
ridiculousfish
9bc5d60eaf Clean up enum_set.h header
Include a missing array header, and switch to idiomatic include guards.
2019-04-26 16:08:19 -07: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
Fabian Homborg
94ece96bce CHANGELOG path-component
I should really add this immediately.

[ci skip]
2019-04-26 19:17:27 +02:00
Fabian Homborg
009ecfd7e6 src/tokenizer: Add ":@" to the list of non-path-component chars
This makes kill-path-component stop there.

Fixes #5841.
2019-04-26 19:16:21 +02:00
Fabian Homborg
ebf1914a35 CHANGELOG complete -C change
[ci skip]
2019-04-26 16:11:43 +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
Fabian Homborg
22ce8c23c6 builtin_complete: Allow complete -C something
This is a long-standing issue with how `complete --do-complete` does
its argument parsing: It takes an optional argument, so it has to be
attached to the token like `complete --do-complete=foo` or (worse)
`complete -Cfoo`.

But since `complete` doesn't take any bare arguments otherwise (it
would error with "too many arguments" if you did `complete -C foo`) we
can just take one free argument as the argument to `--do-complete`.

It's more of a command than an option anyway, since it entirely
changes what the `complete` call _does_.
2019-04-26 15:02:29 +02:00
ridiculousfish
cd86c0ee88 Remove the COMPLETE_SEP define
It was unused.
2019-04-25 14:23:37 -07:00
ridiculousfish
96bc8a14ca Promote completion_mode_t to a real type
Eliminate big #defines like NO_COMMON.
2019-04-25 14:21:06 -07:00
ridiculousfish
d962668aa0 Remove PATH and COMMAND defines
Also clean up a bit of builtin_complete
2019-04-25 13:26:43 -07:00
ridiculousfish
496529b20a Remove EXPAND prefix from expand_flags and lowercase them 2019-04-25 11:34:49 -07:00
ridiculousfish
d8ab6290e8 Switch expand_flags_t to enum_set 2019-04-25 11:23:03 -07:00
ridiculousfish
dcaac58f45 Rename expand_error_t to expand_result_t and make it class enum
Also lowercase it all.
2019-04-25 10:47:28 -07:00
ridiculousfish
b54c44f2f6 Migrate expansion stages to a new type expander_t
This avoids having to pass around so many parameters during expansion.
2019-04-25 10:47:28 -07:00
Mahmoud Al-Qudsi
ae11bf4dcb Add completions for git show $rev:$path
This command can be used to "`cat`" the contents of `$path` as of `$rev`.

These are "silent" completions, e.g. while this adds a completion for
`git show master:foo`, the completions for `git show <TAB>` are not
affected; these "advanced" completions kick in only after at least
`git show master:<TAB>` to prevent completion pollution or slowing down
tab completions in the typical case (as this would cause each valid and
possibly unique $rev completion result to complete to `n*$rev`
completions for *n* files.

[ci skip]
2019-04-23 21:54:09 -05:00
Mahmoud Al-Qudsi
4bdab33a00 Add dynamic cipher completion to ssh -c ...
[ci skip]
2019-04-22 15:17:38 -05:00
Fabian Homborg
82052a6cc9 Don't start focus reporting until later
[ci skip]
2019-04-21 20:26:57 +02:00
Fabian Homborg
b5351bce1b Bind tmux focus reporting as --preset bindings
Purely cleanup, basically.

[ci skip]
2019-04-21 19:48:46 +02:00
Aaron Gyes
51e963bf44 fixup last commit 2019-04-21 09:07:29 -07:00
Aaron Gyes
9d84b45256 __fish_print_help: remove indent
Do this lame replacement in order to make some_builtin --help
output less tacky.
2019-04-21 02:06:29 -07:00
Aaron Gyes
f309ae05b6 is_visual_escape_seq: whittle down the escape sequences attempted
Some of these we do not need to worry about actually being used
in a prompt.
2019-04-20 17:03:27 -07:00
Mahmoud Al-Qudsi
32ad1a6e62 Add basic completions for FreeBSD's camcontrol 2019-04-19 20:57:27 -05:00
ridiculousfish
fe75a3a650 Migrate autoload file checks to file_id_t 2019-04-19 18:47:07 -07:00
ridiculousfish
6dd2766a15 Remove file_access_attempt_t::stale
It was unused.
2019-04-19 18:26:29 -07:00
Wilke Schwiedop
76306c4582 completions/usermod: various fixes
* -a does not take arguments
* -e more helpful description
* -g add arguments
* -G fix arguments
* add -r to various options
2019-04-20 08:43:43 +08:00
Mahmoud Al-Qudsi
82ef2d19a5 Reduce timeout for jobs regression test
We've been moving away from full second timeouts, they were piling up.
2019-04-19 19:08:16 -05:00
Fabian Homborg
46911a5e7f Revert "__fish_describe_command: Remove awk"
Dealing with macOS output in a fast manner using `string` is surprisingly hard, given that it features lines like

    gls(1), ls(1)            - list directory contents

Printing the "gls" with the description and the "ls" with the description requires a `while read` loop, and that's too slow.

This reverts commit 7784a5f23c.

[ci skip]
2019-04-19 20:57:45 +02:00
Per Bothner
2edfab685a Some comment fixes and renaming of is_iterm2_escape_seq. (#5827)
* Some comment fixes and renaming of is_iterm2_escape_seq.

The comment for is_iterm2_escape_seq incorrectly says "CSI followed by ]".
This is wrong, because CSI is ESC followed by [ (or the seldom-used 0x9b).
The procedure  actually matches Operating System Command (OSC) escape codes.
Since there is nothing iterm2-specific about OSC, is_osc_escape_seq
would be a better name.

Also s_desired_append_char documents a non-existent parameter.

* Update broken iterm2 url in comment.
2019-04-19 09:29:35 -07:00
David Adam
4ddfd73079 add tests for #5824 2019-04-19 14:08:16 +08:00
David Adam
d0735882a3 add tests for the not-quite-fixed #5812 2019-04-18 21:12:25 +08:00
Mahmoud Al-Qudsi
8ca2641857 Revert overzealous !parent_job is_visible() condition
This was added in 04a96f6 but not strictly required to fix #5803
(verified), with the intention of hiding invisible background jobs
(created by invoking a function within a pipeline) from the user, but
that also broke intentionally created jobs from displaying as well.

I'm thinking it can't be done without keeping track of caller context vs
job context.

Closes #5824.
2019-04-17 22:47:41 -05:00
Mahmoud Al-Qudsi
d66ec08819 Add partial aws and ~full aws s3 completions
[ci skip]
2019-04-17 22:37:19 -05:00
David Adam
4d8a82b68f benchmarks: use true executable in path
true is /bin/true on some Linux and /usr/bin/true on macOS.

[ci skip]
2019-04-17 18:31:19 +08:00
ridiculousfish
a173c079d5 expand_abbreviation to always accept an environment_t
Now that snapshotting is fixed, we don't need to get the principal
environment stack any more.
2019-04-16 22:45:58 -07:00
ridiculousfish
2e119813e1 get_abbreviations to accept an environment_t
Now that we don't have dorky snapshotting, thread an dnvironment_t through
get_abbreviations. Removes a usage of env_stack_t::principal().
2019-04-16 22:27:01 -07:00
Aaron Gyes
7e514d2aa5 expand_abbreviation(): escape when looking up abbreviation vars
This was doing exactly the opposite: unescaping and not hitting
the encoded _fish_abbr_X variables when looking up.

Fixes #5573
2019-04-16 21:33:09 -07:00
Aaron Gyes
65bc94c493 Revert "set completions: complete __ variables"
This reverts commit f4e40f2f4b.
2019-04-15 12:57:59 -07:00
Aaron Gyes
92f4a009b3 __fish_config_interactive: disable file completions for builtins
Calling `complete` once here is preferable to adding a bunch of
1 line files to be autoloaded.
2019-04-15 12:49:24 -07:00
Aaron Gyes
89b6b05f88 Fix builtin completions
Command substitution needs parenthesis
2019-04-15 12:24:54 -07:00
Aaron Gyes
f4e40f2f4b set completions: complete __ variables
Now that __ stuff is sorted after a-z, we should not completely
omit them from completions.
2019-04-14 20:35:02 -07:00
ridiculousfish
6b52b0994c Attempt to fix the travis build 2019-04-14 17:43:02 -07:00
ridiculousfish
2fac0f0b39 Correctly lock around umask
umask can only be set, never just queried. Thus we need to lock around
calls to it.

Also guess the value; if we guess right we don't need to reset it.
2019-04-14 16:08:29 -07:00
ridiculousfish
020d4a2848 Adopt env_scoped_t::snapshot() and remove env_var_snapshot_t
Remove the env_var_snapshot_t class and switch everything to the new snapshot
function of env_scoped_t.

Fixes #5658. Fixes #5571.
2019-04-14 15:50:38 -07:00
ridiculousfish
64584a6624 Add a snapshot function to env_scoped_t
Allow creating lightweight read-only copies of a scoped environment.
2019-04-14 15:50:30 -07:00
ridiculousfish
0ca3ae7c7e Rejigger var_stack_t's ctors
Prepare var_stack_t to support snapshotting.
2019-04-14 15:50:24 -07:00
ridiculousfish
69655ef5c1 Reorganize env.cpp
Group functions together more logically
2019-04-14 15:50:19 -07:00
ridiculousfish
1d464da698 Introduce env_scoped_t
env_scoped_t lives between environment_t and env_stack_t.
It represents the read-only logic of env_stack_t and will be used to back
the new environment snapshot implementation.
2019-04-14 15:50:12 -07:00
ridiculousfish
46fd47a0da Organize some code slightly better in env.h 2019-04-14 15:50:06 -07:00
Mahmoud Al-Qudsi
a9e0990773 Add changelog note about parser error propagation fix
..as this affects backwards compatibility (as witnessed by the tests
that failed after making this fix).
2019-04-13 17:28:16 -05:00
Mahmoud Al-Qudsi
2dfc85245f Add regression tests for eval 2019-04-13 17:28:16 -05:00
Mahmoud Al-Qudsi
05f52924c1 Fix bad tests
These tests used raw, unescaped parentheses to perform `test` logical
grouping, but the test failures weren't caught because the parser
evaluation errors were not being propagated (fixed in bdbd173e).
2019-04-13 17:28:16 -05:00
Mahmoud Al-Qudsi
b2a1da602f Fix error propagation in parser_t::eval
It was unconditionally returning `parse_execution_success`. This was
causing certain parser errors to incorrectly return after evaluation
with `$status` equal to `0`, as reported after `eval`, `source`, or
sub-`fish` execution.
2019-04-13 17:28:16 -05:00
Mahmoud Al-Qudsi
8e4010b263 Make eval override previous status
Closes #5692 (again).
2019-04-13 17:28:10 -05:00
Mahmoud Al-Qudsi
47a61a3202 Test: validate $status is preserved on calling into a function 2019-04-13 17:21:13 -05:00
Mahmoud Al-Qudsi
ab37dfaf78 Add tests for evaluaton of empty blocks and functions 2019-04-13 17:21:13 -05:00
Mahmoud Al-Qudsi
87f6856954 Fix tests expecting non-zero status after empty function call 2019-04-13 17:21:13 -05:00
Mahmoud Al-Qudsi
4530a41004 Fix return code after execution of empty function 2019-04-13 17:21:13 -05:00
ridiculousfish
cc9386fca9 Clean up some headers in env and env_dispatch.cpp 2019-04-13 14:39:20 -07:00
ridiculousfish
2537fe0f9e Put back a missing lock in env_stack_t::set_internal
Setting a variable could race with getting it.

The lockin^g here needs a serious overhaul.
2019-04-13 12:40:58 -07:00
ridiculousfish
2f1e572756 Minor cleanup of env_node_t
Mark some fields const that don't need to change. Trying to get ready to
improve locking here.
2019-04-13 12:40:58 -07:00
ridiculousfish
372291ad02 Collapse a weirdly structured clause in env.cpp 2019-04-13 12:40:57 -07:00
ridiculousfish
a597b0e6e1 Remove get_proc_had_barrier
Prior to this change, fish used a global flag to decide if we should check
for changes to universal variables. This flag was then checked at arbitrary
locations, potentially triggering variable updates and event handlers for
those updates; this was very hard to reason about.

Switch to triggering a universal variable update at a fixed location,
after running an external command.  The common case is that the variable
file has not changed, which we can identify with just a stat() call, so
this is pretty cheap.
2019-04-13 12:40:57 -07:00
ridiculousfish
341799194e Factor out fetching electric variables into a separate function
This factors env_stack_t::get() a little better
2019-04-13 12:40:57 -07:00
ridiculousfish
f35f2fe110 Mark the benchmark as using the terminal
Prevents buffering all output from the command.
2019-04-13 12:40:12 -07:00
ridiculousfish
e634abc1c8 Add a benchmark for external commands
This just runs '/usr/bin/true' a lot.
2019-04-13 12:40:09 -07:00
ridiculousfish
2c7dc98337 Revert "fcntl a little less"
This reverts commits:
e5362a4ae5.
dd9a26715d.

These commits were incorrect because they stomped other flags, such as
O_NONBLOCK.
2019-04-13 12:27:05 -07:00
ridiculousfish
13c5f93d63 Revert "Optimize function calls by reducing inherit vars heap allocations and copies"
This reverts commit cdce8511a1.

This change was unsafe. The prior version (now restored) took the lock and
then copied the data. By returning a reference, the caller holds a
reference to data outside of the lock.

This function isn't worth optimizing. Hardly any functions use this
facility, and for those that do, they typically just capture one or two
variables.
2019-04-13 12:03:02 -07:00
Mahmoud Al-Qudsi
cdce8511a1 Optimize function calls by reducing inherit vars heap allocations and copies
* Convert `function_get_inherit_vars()` to return a reference to the
  (possibly) existing map, rather than a copy;
* Preallocate and reuse a static (read-only) map for the (very) common
  case of no inherited vars;
* Pass references to the inherit vars map around thereafter, never
  triggering the map copy (or even move) constructor.

NB: If it turns out the reference is unsafe, we can switch the inherit vars
to be a shared_ptr and return that instead.
2019-04-13 11:26:10 -05:00
David Adam
56125f73e4 env: trigger locale updates if LOCPATH changes
Closes #5815.
2019-04-13 21:58:54 +08:00
ridiculousfish
47b9907113 Remove an unused variable 2019-04-12 23:03:28 -07:00
ridiculousfish
4e1fdaf5a7 Use move semantics in builtin_eval
Saves some allocations
2019-04-12 23:02:45 -07:00
ridiculousfish
c95e1b83c7 Minor cleanup of eval builtin
Fix some copy and paste errors, remove some dead variables and code,
make the return a bit more structured.
2019-04-12 22:42:27 -07:00
Mahmoud Al-Qudsi
5989a92dae Add completions for rg (ripgrep)
[ci skip]
2019-04-12 15:20:45 -05: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
a8030c020b src/fish_indent.cpp: Fix return-value warning 2019-04-12 15:38:38 +02:00
Mahmoud Al-Qudsi
e0e0fe9dd3 Re-implement eval as a regular builtin
I did not realize builtins could safely call into the parser and inject
jobs during execution. This is much cleaner than hacking around the
required shape of a plain_statement.
2019-04-12 07:04:15 -05:00
Geographer
9cf1b18b26 Honor dirprev scope (#5796)
* Honour `dirprev` scope

Honour the scope of the `dirprev` variable if it is universal
and avoid to shadow it with a global. This enables to share
the `cd` history between sessions.

* Honor dirnext and __fish_cd_direction scope

If these variables exist in the universal scope, do not shadow them
2019-04-12 09:43:34 +02:00
Fabian Homborg
898ed12a6c Merge pull request #5795 from cstyles/git-completions
Add git completions
2019-04-12 09:42:52 +02:00
Fabian Homborg
e672b03993 functions/fish_hg_prompt: Remove --color and --pager
These weren't added long enough ago, and I only added them
speculatively.

So it should make it work with old hg versions.

CC @zanchey.

[ci skip]
2019-04-12 09:01:34 +02: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
Aaron Gyes
014ab7935e Test expansion syntax errors.
If there is a better way to do stuff that will stop execution than
fish -c for our tests, please let me know.
2019-04-11 21:59:23 -07:00
Aaron Gyes
1834e962d2 Correct carat position for unexpected } in brace expansion
before:

$ echo {}}-
fish: Unexpected '}' for unopened brace expansion

$ ./fish -c 'echo {}}}}'
fish: Unexpected '}' for unopened brace expansion
echo {}}}}
^

now:
$ echo {}}}}}}1-
fish: Unexpected '}' for unopened brace expansion
echo {}}}}}}
       ^
2019-04-11 17:18:53 -07:00
Aaron Gyes
75db3b4ff4 fix incorrectly aligned carat in command expansion errors and more
- fix the carat position expanding e.g. `command $,`
- improve the error reporting for not-allowed command subtitutions
  by figuring out where the expansion failed instead of using
  SOURCE_LOCATION_UNKNOWN
- allow nullptr for parse_util_licate_brackets_range() out_string
  argument if we don't need it to do any work.

Fixes #5812
2019-04-11 14:44:46 -07:00
Mahmoud Al-Qudsi
4539a9db15 Drop unused include in src/exec.cpp
It was added in 2544c622841fd8b7317109f12fe4eb55c5ea1d0a,
and caught by @faho.
2019-04-11 13:01:29 -05:00
Mahmoud Al-Qudsi
0cf0829c5f Add comment clarifying presence of empty eval function 2019-04-11 12:59:04 -05:00
Mahmoud Al-Qudsi
b82fa187ea Changelog: mention changes to eval scoping 2019-04-11 11:55:12 -05: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
Mahmoud Al-Qudsi
4d54147e7e Merge branch 'eval_parser'
Implements `eval` in cpp rather than as a fish function.
2019-04-11 10:41:33 -05:00
Mahmoud Al-Qudsi
da20d197b4 Add regression test for eval scope (#4443) 2019-04-11 10:40:22 -05:00
Mahmoud Al-Qudsi
2fe2169065 Make eval a decorator
`eval` has always been implemented as a function, which was always a bit
of a hack that caused some issues such as triggering the creation of a
new scope. This turns `eval` into a decorator.

The scoping issues with eval prevented it from being usable to actually
implement other shell components in fish script, such as the problems
described in #4442, which should now no longer be the case.

Closes #4443.
2019-04-11 10:36:49 -05:00
Aaron Gyes
90547a861a __fish_macos_set_env: don't create empty PATH components
It was creating empty entries for blank lines, which will actually
create '.' for colon-separated vars

Fixes #5809
2019-04-11 02:52:18 -07:00
ridiculousfish
f7817a2586 Remove env_node_t::contains_any_of
Dead code...
2019-04-10 23:18:30 -07:00
Mahmoud Al-Qudsi
0bda853dc7 Add detection of eval to the parser
While `eval` is still a function, this paves the way for changing that
in the future, and lets the proc/exec functions detect when an eval is
used to allow/disallow certain behaviors and optimizations.
2019-04-10 21:19:57 -05:00
Collin Styles
502efb0f3e Improve descriptions 2019-04-10 19:11:52 -07:00
Aaron Gyes
f086064d72 add --print-rusage-self to completions 2019-04-10 16:41:26 -07:00
ridiculousfish
c39950e49a Add benchmark target to CMake
This adds a benchmark target to CMake to run the new benchmarks.

example: ninja benchmark
2019-04-10 14:35:59 -07:00
ridiculousfish
2d4872ba60 Add a benchmark driver and a simple benchmark
This adds a simple script that drives benchmarks, and a simple sample
benchmark.
2019-04-10 14:34:25 -07: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
25dd22242d Adjust __fish_print_help for sphinx
This is beyond cheesy, but it seems to work.

Fixes #5782.
2019-04-10 18:20:25 +02: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
Mahmoud Al-Qudsi
04a96f6c6e Change when PENDING_REMOVAL jobs are removed
Followup to 394623b.

Doing it in the parser meant only top-level jobs would be reaped after
being `disown`ed, as subjobs aren't directly handled by the parser.

This is also much cleaner, as now job removal is centralized in
`process_clean_after_marking()`.

Closes #5803.
2019-04-10 11:00:48 -05: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
Artur Juraszek
cece4d81c1 completions/pinky: Prompt with users list 2019-04-10 12:46:36 +02:00
Mahmoud Al-Qudsi
394623bf08 Prevent disown from directly removing jobs
This prevents the `disown` builtin from directly removing jobs out of
the jobs list to prevent sanity issues, as `disown` may be called within
the context of a subjob (e.g. in a function or block) in which case the
parent job might not yet be done with the reference to the child job.

Instead, a flag is set and the parser removes the job from the list only
after the entire execution chain has completed.

Closes #5720.
2019-04-09 23:29:58 -05:00
Collin Styles
3cfa5d422e Remove string match; use string replace's --filter option 2019-04-09 20:59:48 -07:00
Mahmoud Al-Qudsi
f1b261388a Fix build error on old (buggy?) versions of libstdc++
Closes #5801.
2019-04-09 22:43:32 -05:00
Mahmoud Al-Qudsi
a21c65a5ac Makefile: Correct search for cmake 2019-04-09 22:32:29 -05:00
Mahmoud Al-Qudsi
ab1519acef Fix high CPU usage in subsequent select(2) calls
The timeout was being reset to zero, so `select` was being called in a
very tight loop.

Closes #5761.
2019-04-09 21:10:30 -05:00
Mahmoud Al-Qudsi
49935f13df Add completions for git bisect
[ci skip]
2019-04-09 20:36:42 -05:00
Mahmoud Al-Qudsi
e296e3c505 Makefile: Replace literal cmake usage with $(CMAKE) 2019-04-09 20:06:41 -05:00
Mahmoud Al-Qudsi
20db22f0fe Add basic make shim for CMake
This lets non-developers simply `cd` into the fish source directory and
execute `make` to build the project. The Makefile searches for CMake and
hands over the build to it if it is available, otherwise an error
message is emitted. All dependency checking is left to CMake.

Non-fish-devs shouldn't have to concern themselves with what build
system fish developers have chosen, and building a random C++ project
should not be a chore in familiarizing one's self with all the various
build platforms out there.

CMake is instructed to use `ninja` if it is available, otherwise the
standard Unix Makefiles generator option is used.

(This has already been the behavior on BSDs since CMake was adopted.)
2019-04-09 19:58:48 -05:00
David Adam
d6a4694d9f tests: add test for invalid variable name in for loop
Work on #5800.
2019-04-09 20:10:57 +08:00
David Adam
c6c0c9bfdf use standard warning for invalid variable in for loop
Work on #5800.
2019-04-09 20:10:57 +08: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
Aaron Gyes
3b97e2d7ec Stop caching set_color output in rest of prompts
No more __fish_prompt_* variables.
2019-04-09 03:40:09 -07:00
Aaron Gyes
5f7f4c638f informative.fish: stop caching_set_color, use br* directly
No longer uses global vars to cache set_color output, this was
from before set_color was a builtin, it is pointless now.

This is also a prompt from before we had bright named colors,
and it appears it was relying on -o red to get bright red.
so use brred, etc.
2019-04-09 03:13:45 -07:00
Aaron Gyes
b002eb350c Get rid of __fish_repaint_root
it's identical to __fish_repaint - so just register that for both
variable change events.
2019-04-09 00:29:22 -07:00
ridiculousfish
ef88e959ac Merge branch 'pygments'
This adds support for a fish_indent driven pygments syntax highlighter
to the sphinx docs build.
2019-04-08 20:14:12 -07: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
93cc99d6d0 Teach CMake to tell Sphinx where fish_indent is 2019-04-08 19:11:10 -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
ridiculousfish
e44cb235a7 Add pygments CSV output to fish_indent
This will allow pygments to highlight fish code using fish_indent.
2019-04-08 19:09:41 -07:00
ridiculousfish
51e5077d98 Merge branch 'env_dispatch'
This merges a bunch of changes that migrate logic from env.cpp to a new file
env_dispatch.cpp. env_dispatch is concerned with dispatching changes to
variables, while env.cpp is the "core."
2019-04-08 16:22:22 -07:00
ridiculousfish
3e14f96d40 Eliminate string_set_contains 2019-04-08 16:22:04 -07:00
ridiculousfish
1caf20f7c3 Migrate the read limit into env_dispatch 2019-04-08 16:22:04 -07:00
ridiculousfish
fa0a6ae096 Move locale and curses init from env to env_dispatch 2019-04-08 16:22:04 -07:00
ridiculousfish
11651dec7a Clean up env_stack_t::pop
Use the new dispatch mechanism to reduce duplication
2019-04-08 16:22:04 -07:00
ridiculousfish
a4fe3c87ae Switch certain environment callbacks from named to anonymous 2019-04-08 16:22:04 -07:00
ridiculousfish
987e41de12 Remove the op from env_dispatch
Environment dispatch passes strings like "ERASE" and "SET" but nobody
ever looks at those. Just get rid of them.
2019-04-08 16:22:04 -07:00
ridiculousfish
dc729653be Migrate pop complexity from vars_stack_t to env_stack_t
When popping a scope from the environment stack, we currently do a lot of
nonsense like looking for changed curses variables. We want to centralize
this in env_stack_t so that it can be migrated to the env_dispatch logic.
Move this logic up one level in preparation for doing that.
2019-04-08 16:22:04 -07:00
ridiculousfish
59fb5b1849 var_stack_t::pop() to return the popped node 2019-04-08 16:22:04 -07:00
ridiculousfish
0c5809a088 Minor cleanup of env_node_t 2019-04-08 16:22:04 -07:00
ridiculousfish
ab67354192 Migrate fish_use_posix_spawn into env_dispatch 2019-04-08 16:22:04 -07:00
ridiculousfish
e7de9cc371 Migrate some env initialization into env_dispatch 2019-04-08 16:22:04 -07:00
ridiculousfish
b67174b4a3 Clean up env_dispatch_table 2019-04-08 16:22:04 -07:00
ridiculousfish
b7fceddfc8 Refactor some environment code into env_dispatch.cpp
This new file is supposed to encapsulate all of the logic around
reacting to variable changes, as opposed to the environment core.
This is to help break up the env.cpp monolith.
2019-04-08 16:22:04 -07:00
Aaron Gyes
e5362a4ae5 wutil.cpp: fixup: don't involve the uninitialized parameter 2019-04-08 16:02:00 -07:00
Aaron Gyes
8eb05f8731 parse_execution.cpp: validate 'for' variable name
Fixes #5800
(that's a nice round number)
2019-04-08 11:23:00 -07:00
Aaron Gyes
dd9a26715d fcntl a little less
Setting O_CLOEXEC on closed file descriptors and getting E_BADF
should be faster than actually checking if an fd is open first.
2019-04-08 11:23:00 -07:00
ridiculousfish
bf40f84b06 Remove an unused variable 2019-04-07 15:07:36 -07:00
ridiculousfish
35b3f7fee8 Reduce loop count of pipeline test
Make the test run faster
2019-04-07 15:00:13 -07:00
ridiculousfish
f5bb8639d6 More aggressively inherit pgrps from parent jobs
Prior to this fix, a job would only inherit a pgrp from its parent if the
first command were external. There seems to be no reason for this
restriction and this causes tcsetgrp() churn, potentially cuasing SIGTTIN.
Switch to unconditionally inheriting a pgrp from parents.

This should fix most of #5765, the only remaining question is
tcsetpgrp from builtins.
2019-04-07 13:35:00 -07:00
ridiculousfish
4d62af7d40 Add pipeline tests
This adds a pipeline test covering the fix in the prior commit,
related to #5675. Note #5675 is NOT fully fixed by this.
2019-04-07 09:20:32 -07:00
ridiculousfish
39a9740997 Be less aggressive about reclaiming the foreground pgrp
Prior to this fix, in every call to job_continue, fish would reclaim the
foreground pgrp. This would cause other jobs in the pipeline (which may
have another pgrp) to receive SIGTTIN / SIGTTOU.

Only reclaim the foreground pgrp if it was held at the point of job_continue.

This partially addresses #5765
2019-04-07 09:20:32 -07:00
ridiculousfish
23d88e0e03 Add fish_test_helper executable
In tests we would like to arrange for an executable to invoke certain
system calls, e.g. to claim or relinquish control of the terminal. This is
annoying to do portably via e.g. perl. fish_test_helper is a little
program where we can add custom commands to make it act in certain ways.
2019-04-07 09:20:19 -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
Collin Styles
724dd06c62 Add completions for git-help 2019-04-06 14:04:28 -07:00
Fabian Homborg
78931d78bd completions/git: Handle diff --cached
Fixes #5785.

[ci skip]
2019-04-06 21:45:17 +02:00
Collin Styles
2226a87b59 Add completions for git-worktree 2019-04-06 12:24:24 -07:00
Collin Styles
82596465b2 Add completions for git-describe 2019-04-06 12:24:24 -07:00
Collin Styles
0bd8c61e7e Add completions for git-ls-files 2019-04-06 12:24:24 -07:00
Collin Styles
6e3c87f4c3 Add completions for git-merge-base 2019-04-06 12:24:24 -07: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
Aaron Gyes
4e555aebec Remove is_whitespace and whitespace character string declarations
I don't doubt such functions and character arrays could be useful,
to keep things consistent, but they are not actually being used.
2019-04-06 02:07:56 -07: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
Fabian Homborg
2a3677b386 Stop setting term-modes early
This set the term modes to the shell-modes, including disabling
ICRNL (translating \cm to \cj) and echo.

The rationale given was that `reader_interactive_init()` would only be
called >= 250ms later, which I _highly_ doubt considering fish's total
startup time is 8ms for me.

The main idea was that this would stop programs like tmuxinator that
send shortcuts early from failing _iff_ the shortcut was \cj, which
also seems quite unusual.

This works both with `rm -i` and `read` in config.fish, because `read`
explicitly calls `reader_push`, which then initializes the shell modes.

The real fix would involve reordering our init so we set up the
modesetting first, but that's quite involved and the remaining issue
should barely happen, while it's fairly common to have issues with a
prompt in config.fish, and the workaround for the former is simpler, so let's leave it for now.

Partially reverts #2578.

Fixes #2980.
2019-04-05 12:55:13 +02:00
Mahmoud Al-Qudsi
2e6264558c Fix remaining realpath test issue with symlinks
Pursuant to 0be7903859, there still
remained one issue with the test when run from within a symlinked
directory after fish gained support for cding into symlinks.

This change should make the test function OK both when the tests are run
out of a PWD containing a symlink in its hierarchy and when run
otherwise.
2019-04-04 22:25:45 -05:00
Aaron Gyes
be80a56ad4 expand.cpp: use wcspbrk for is_quotable 2019-04-04 17:32:39 -07:00
Aaron Gyes
b4ddd797e3 remove unused wcstring 2019-04-04 14:24:36 -07:00
Aaron Gyes
b064eaa571 use std::move in a couple spots where things were unsed after copy 2019-04-04 14:16:34 -07:00
Aaron Gyes
09e8f0fd7c rearrange structure fields
Putting larger members before smaller ones will reduce structure
sizes. bools are 1 byte. on 64bit systems I think they reduced:

wgetopt.h:46: 64 to 56 bytes
builtin_history.cpp:30: 48 to 32 bytes
builtin_status.cpp:91: 32 to 24 bytes
tinyexpr.cpp:69: 40 to 32 bytes
2019-04-04 13:47:10 -07:00
Mahmoud Al-Qudsi
bc66921ac9 Optimize keyword detection
The data stored in these containers is small enough that it is worth
creating distinct sets for each lookup.

In a microbenchmark of these changes, the single-lookup version of the
function with lookups gated on the length of input (bypassed entirely if
the input is longer than the longest key in the container) provided a
1.5x-3.5x speedup over the previous implementation.

Additionally, as the collections are static and their contents are never
modified after startup, it makes no sense to continously calculate the
location of and allocate an iterator for the `!= foo.end()` comparison;
the end iterator is now statically cached.

I'm not expecting massive speed gains out of this change, but the parser
does perform enough of these to make it worth optimizing in this way.
2019-04-03 20:53:29 -05:00
ridiculousfish
e2ed6baf43 Make the output/errput test more robust by sorting output 2019-04-03 16:50:13 -07:00
Fabian Homborg
318fe3c046 docs/string: Replace doesn't do globs
As a bit of weirdness in string's design, replace does literal
matching (`*` aren't expanded) by default, not globs.

[ci skip]
2019-04-03 19:49:38 +02:00
Fabian Homborg
aa3dff098c docs/string: Add paragraph on comparison with unix tools
[ci skip]
2019-04-02 12:46:23 +02:00
ridiculousfish
dd007c29f4 Revert "parser: try to avoid some strings being copied"
This reverts commit 7a74198aa3.

Believe it or not this commit actually increased copying. When accepting
a value you know you're going to take ownership of, just accept it by
value; then temporaries can invoke the move ctor and blah blah blah.

We really need a lightweight refcounted pass-by-value string to make this
less error prone.
2019-04-01 20:22:02 -07:00
Fabian Homborg
ab92baf671 CHANGELOG repaint-mode
[ci skip]
2019-04-01 16:14:00 +02:00
Fabian Homborg
99dd6d7394 Let repaint-mode act like a repaint if no fish_mode_prompt exists
Otherwise I'm pretty sure we'd get complaints from people who use a
mode-indicator elsewhere in their prompts.
2019-04-01 16:04:14 +02:00
Fabian Homborg
bc958712e4 CHANGELOG INTERNAL_WCWIDTH
[ci skip]
2019-04-01 16:02:09 +02:00
Fabian Homborg
8ff866b26b Add repaint-mode bind function
If we switch the bind mode, we add a "force-repaint" there just to
redraw the mode indicator.

That's quite wasteful and annoying, considering that sometimes the prompt can take
half a second.

So we add a "repaint-mode" function that just reexecutes the
mode-prompt and uses the cached values for the others.

Fixes #5783.
2019-04-01 15:59:39 +02:00
Fabian Homborg
da1b32f0ad Remove option to use system wcwidth (#5777)
As it turns out it didn't work much better, and it fell behind in
support when it comes to things that wcwidth traditionally can't
express like variation selectors and hangul combining characters, but
also simply $fish_*_width.

I've had to tell a few people now to rebuild with widecharwidth after
sending them on a fool's errand to set X variable.

So keeping this option is doing our users a disservice.
2019-04-01 15:59:33 +02:00
Fabian Homborg
0d72912641 Expand abbr explicitly (#5762)
* Add "expand-abbr" bind function

This can be used to explictly allow expanding abbreviations.

* Make expanding abbr explicit

NOTE: This accepts them for space only, we currently also do it for \n
and \r.

* Remove now dead code

We no longer trigger an abbr implicitly, so we can remove the code
that does it.

* Fix comment

[ci skip]
2019-04-01 15:59:15 +02:00
Aaron Gyes
469a8880aa correct 'bind' completions
--new-mode isn't even an option `bind` takes, and it
-m for -M.
2019-03-31 21:38:23 -07:00
Mahmoud Al-Qudsi
eb2d829bc5 Use explicit lock.exchange()
There's really no point in using std::atomic if we're not going to
actually guarantee the entire read & write process is atomic.
2019-03-31 18:17:33 -05:00
Mahmoud Al-Qudsi
b5b9406711 Use explicit atomic/CAS to prevent race conditions
They are probably equivalent on x86/64 being single-byte reads/writes,
but it never hurts to be safe.
2019-03-31 18:09:59 -05:00
Mahmoud Al-Qudsi
3c537bfa65 Optimize get_deferred_process() traversal 2019-03-31 13:20:49 -05:00
Lily Ballard
aafd706a34 Replace Doxygen reference in README with Sphinx
Also update a comment in the `make_tarball.sh` script.
2019-03-31 21:39:03 +08:00
Fabian Homborg
95ab71c456 docs: Another bit of dehtml-izing
[ci skip]
2019-03-31 12:00:27 +02:00
Fabian Homborg
6c234a7385 docs: Remove a table
This was html, and I don't think it helped all that much, so let's
remove it instead of translating to rst.

[ci skip]
2019-03-31 11:56:12 +02:00
Fabian Homborg
eb3bbb1360 docs: Fix example link 2019-03-31 11:50:28 +02:00
Fabian Homborg
ac61d3f34d docs: More references
Including two more href.
2019-03-31 11:48:35 +02:00
Fabian Homborg
127c0e9764 docs: Fix remaining references
Fixes #5775.
2019-03-31 11:35:02 +02:00
Fabian Homborg
e2cf10dd4f docs: More command labels
[ci skip]
2019-03-31 11:28:13 +02:00
Fabian Homborg
bda3fb7740 docs: Fix a few wrong verbatim blocks
Wrong number of backticks.

[ci skip]
2019-03-31 11:25:07 +02:00
Fabian Homborg
86d4574222 docs: Use more command labels 2019-03-31 11:24:04 +02:00
Fabian Homborg
cb94dd4d30 docs: Use command labels
[ci skip]
2019-03-31 11:15:57 +02:00
Fabian Homborg
cf9b8fa3fa docs: Add labels to all commands
This allows us to use :ref: references, which don't require hardcoding
it as html

[ci skip]
2019-03-31 11:05:33 +02:00
Fabian Homborg
c693687812 docs: Add missing >
"Anonymous hyperlink" strikes again!

[ci skip]
2019-03-31 10:55:17 +02:00
Fabian Homborg
90958f2402 CHANGELOG $PATH reordering
[ci skip]
2019-03-30 21:25:27 +01:00
Fabian Homborg
64ff3492a7 srht: Remove NetBSD build
This isn't officially supported (yet?), and it's currently broken.

It doesn't include ssl certificates,
and I can't see a way to add them or disable verification before it attempts to clone the git repo.

Ironically:

[ci skip]
2019-03-30 21:13:32 +01:00
Fabian Homborg
0c4580d874 docs: Fix moar reference syntax 2019-03-30 20:44:07 +01:00
Fabian Homborg
203927245d docs: Fix reference syntax
Fixes #5776.

[ci skip]
2019-03-30 20:28:09 +01:00
Fabian Homborg
7aaa3b8553 Keep the order for $PATH and $MANPATH when reading /etc/paths (#5767)
* Keep the order for $PATH and $MANPATH when reading /etc/paths

Fixes #5456.
2019-03-30 19:25:09 +01:00
ridiculousfish
0aa0dceeb3 End coalescing repaints on check-exits
Hopeful fix for #5766
2019-03-29 20:56:23 -07:00
Fabian Homborg
1937e409f7 completions/find: Fix typo 2019-03-29 17:46:01 -05:00
Mahmoud Al-Qudsi
93b02dcec4 Don't use camcontrol in FreeBSD zpool completions
It requires root/su privileges to list devices, and we have a great
alternative that already produces the desired results.
2019-03-29 17:43:03 -05:00
Fabian Homborg
fc7d11d7b8 Update zpool completions to use string instead of grep 2019-03-29 17:37:26 -05:00
Fabian Homborg
03a6fb4a69 docs/license: Fix "anonymous hyperlink" warning
Apparently an anonymous hyperlink looks like `__something__`.

I had to find this by deleting parts of the document and building to
narrow it down until I had the line, because sphinx wouldn't give a
line number.

See #5696.

[ci skip]
2019-03-29 21:13:10 +01:00
Fabian Homborg
82d55aeb84 docs: Fix warnings
This was:

- Some `` mismatches - it's "``something``", not "``something`".

- Some "explicit targets", which IMHO are quite a misfeature - `word
  <link>`_ has to be unique, which I don't see a usecase for. Instead
  use `word <link>`__, with a double-underscore at the end.

- One case of `||` which I just removed

See #5696.

[ci skip]
2019-03-29 21:07:36 +01:00
Fabian Homborg
191b74df6f docs: Fix some sphinx errors
See #5696.

[ci skip]
2019-03-29 20:55:28 +01:00
Fabian Homborg
3912d86ed8 docs/cmds/bind: Fix synopsis 2019-03-29 20:16:10 +01:00
Fabian Homborg
408c555bd6 docs/cmds/alias: Fix emphasis 2019-03-29 20:15:59 +01:00
Fabian Homborg
21bac8428e docs/cmds/string: Fix lists
sphinx _really_ likes its empty lines before lists!

[ci skip]
2019-03-29 20:12:28 +01:00
Fabian Homborg
b8570a9e8a docs/cmds/string: Improve synopsis
This both formats it as a code-block, and adds the synopsis of each
subcommand to the corresponding section again so you don't need to
scroll back-and-forth so much.

[ci skip]
2019-03-29 20:11:23 +01:00
Fabian Homborg
ebc0bee404 docs: Correct link
We're gonna have a bunch of these, aren't we?

[ci skip]
2019-03-29 19:09:57 +01:00
Fabian Homborg
a361d987f8 docs: Add toctree back
Apparently there must indeed be a toctree somewhere in the document to
get the links to the other docs to show up.

Even a ":hidden:" toctree doesn't help - that just leads to an empty
toc in the sidebar (no idea yet where that's defined!).

I've added it to the end so it's not that weird "Commands" section in
the middle.

[ci skip]
2019-03-29 19:08:25 +01:00
ridiculousfish
0b11b8cffb Revert "Optimize identification of deferred process"
This reverts commit 4aea4c09b3.

Said commit broke many tests
2019-03-28 20:22:58 -07:00
ridiculousfish
7231d86676 Fix the tests
Remove 'pwd-resolved-to-itself' message
2019-03-28 20:18:45 -07:00
Mahmoud Al-Qudsi
4aea4c09b3 Optimize identification of deferred process 2019-03-28 22:12:50 -05:00
Mahmoud Al-Qudsi
0be7903859 Drop realpath test built on assumption PWD cannot be a symlink
The final test in `realpath.in` was based on the no-longer-valid
assumption that $PWD cannot be a symlink. Since the recent changes in
fish 3.0 to allow `cd`ing into "virtual" directories preserving symlinks
as-is, when `make test` was  run from a path that contained a symlink
component, this test would fail the `pwd-resolved-to-itself` check.

As the test is not designed to initialize then cd into an absolute path
guaranteed to not be symbolic, so this final check is just wrong.
2019-03-28 19:05:33 -05:00
Mahmoud Al-Qudsi
f8b2e818ed Remove legacy generic process/job exit events 2019-03-28 18:55:36 -05:00
Mahmoud Al-Qudsi
7f5e58ae69 Only send JOB_EXIT after the job has been actually erased 2019-03-28 18:55:36 -05:00
Mahmoud Al-Qudsi
06adb1dc38 Store jobs to erase in separate list 2019-03-28 18:55:36 -05:00
Mahmoud Al-Qudsi
36f3a6d7e0 Use const auto for all jobs 2019-03-28 18:55:36 -05:00
Mahmoud Al-Qudsi
d4d5c03a03 Clean up invalid job id detection in fg builtin 2019-03-28 18:55:36 -05:00
Mahmoud Al-Qudsi
1f59976c2c Further clean up job list manipulation 2019-03-28 18:55:36 -05:00
Mahmoud Al-Qudsi
6fab783647 Convert job_list to a dequeue again
Now that we have cleaned up access to the job list and removed
transparent invalidation of iterators, it is safe to convert it to a
dequeue.
2019-03-28 18:55:36 -05:00
Mahmoud Al-Qudsi
f8e0e0ef82 Remove abstractions around job list
Directly access the job list without the intermediate job_iterator_t,
and remove functions that are ripe for abuse by modifying a local
enumeration of the same list instead of operating on the iterators
directly (e.g. proc.cpp iterates jobs, and mid-iteration calls
parser::job_remove(j) with the job (and not the iterator to the job),
causing an invisible invalidation of the pre-existing local iterators.
2019-03-28 18:55:36 -05:00
Mahmoud Al-Qudsi
0c5015d467 Correct the reversed diff output for all tests
This has been driving nuts for years. The output of the diff emitted
when a test fails was always reversed, because the diff tool is called
with `${difftool} ${new} ${old}` so all the `-` and `+` contexts are
reversed, and the highlights are all screwed up.

The output of a `make test` run should show what has changed from the
baseline/expected, not how the expected differs from the actual. When
considered from both the perspective of intentional changes to the test
outputs and failed test outputs, it is desirable to see how the test
output has changed from the previously expected, and not the other way
around.

(If you were used to the previous behavior, I apologize. But it was
wrong.)
2019-03-28 18:23:32 -05:00
Fabian Homborg
6cf61d5235 docs/fish_git_prompt: Fix formatting
Sphinx likes empty lines before lists.

Also give variable names the ``treatment``.

[ci skip]
2019-03-28 22:11:28 +01:00
Fabian Homborg
c94fe0f8c9 docs/fish_git_prompt: Document default settings
This should help with interpreting the results.

All this is quite convoluted, especially with defaults dependent on
other settings.

[ci skip]
2019-03-28 21:16:05 +01:00
Fabian Homborg
42acbaa5af Remouve ouveroused U
Webster was right, gosh dang it!

[ci skip]
2019-03-28 12:31:52 +01:00
Fabian Homborg
21d8b465cc nextd/prevd: Print BEL instead of "Hit end of history"
That message is just hugely annoying.

Hat-tip to @floam and d524bad5f16b5a18c22fefe440.
2019-03-28 11:58:53 +01:00
ridiculousfish
5441ebc91f Remove some dead code 2019-03-28 00:38:12 -07:00
Fabian Homborg
785945c861 src/builtin_test: Print backtrace on error
`test` is a common source of problems, and with the current system
they can be quite hard to find.

So we print a backtrace with line numbers and all.
2019-03-28 08:35:32 +01:00
Fabian Homborg
d8ec4685ff src/builtin_test: Remove weird leading tab from error message
This is a remainder from when we used to speak of "eval errors".
2019-03-28 08:35:32 +01:00
Fabian Homborg
e2ce63ff62 functions/help: Adjust command paths to sphinx
We now build a separate page per-command in cmds/$cmd.html instead of
a section in the "commands.html" page.

See #5696.

[ci skip]
2019-03-27 12:46:51 +01:00
Fabian Homborg
4e7795217d docs: Replace @cursor_key
Should be the last of them.

See #5696.

[ci skip]
2019-03-27 12:44:10 +01:00
Fabian Homborg
6a9079899d docs: Add an annotated completion example
It's not _perfect_, but should hopefully ease the introduction a
teensy bit.

We use `timedatectl` because it's a reasonably simple command that
still uses subcommands and some generated candidates.

[ci skip]
2019-03-27 12:40:38 +01:00
Fabian Homborg
2a51e42ee0 functions/help: Try harder to find a browser on WSL
We now try cmd.exe via $PATH and via a common location, wsl-open, and
an open command.

Fixes #5756.

[ci skip]
2019-03-27 09:06:11 +01:00
Fabian Homborg
248200520e functions/help: Prefer xdg-open/cygstart over open
Some systems like Debian have "open" as a symlink to "openvt" (for... historical
reasons).

See #5756.

[ci skip]
2019-03-27 09:06:11 +01:00
Fabian Homborg
54156845e4 CHANGELOG error changes
[ci skip]
2019-03-26 19:33:26 +01:00
Fabian Homborg
7fa454666d Only append newline if stacktrace isn't empty
This printed weird things like

```fish
$ functions -x
functions: Unknown option '-x'

(Type 'help functions' for related documentation)
```

Instead, let's make it

```fish
$ functions -x
functions: Unknown option '-x'
(Type 'help functions' for related documentation)
```
2019-03-26 19:32:18 +01:00
Fabian Homborg
88d2d54276 Stop printing help summary on error
This now displays

- the error message

- a (significantly shorter) backtrace

- A call to open `help $cmd` if necessary

See #5434.
Fixes #3404.
2019-03-26 19:24:48 +01:00
Fabian Homborg
88a935d8d1 Escape arguments in stacktraces
See #5434.
2019-03-26 17:45:25 +01:00
Fabian Homborg
7095de628c Remove "called on standard input" message
This was printed basically everywhere.

The user knows what they executed on standard input.

A good example:

```fish
set c (subme 513)
```

used to print

```
fish: Too much data emitted by command substitution so it was discarded

    set -l x (string repeat -n $argv x)
             ^
in function 'subme'
	called on standard input
	with parameter list '513'
in command substitution
	called on standard input
```

and now it is

```
fish: Too much data emitted by command substitution so it was discarded

    set -l x (string repeat -n $argv x)
             ^
in function 'subme' with arguments '513'
in command substitution
```

See #5434.
2019-03-26 17:38:41 +01:00
Fabian Homborg
975023faf2 Print arguments on the same line as the function
Now:

```
cd: Unknown option '-r'
~/dev/fish-shell/share/functions/cd.fish (line 40):
    builtin cd $argv
    ^
in function 'cd' with arguments '-r'
in function 'f'
in function 'd'
in function 'b' with arguments '-1q --wurst'
in function 'a'
	called on standard input
```

See #5434.
2019-03-26 17:37:16 +01:00
Fabian Homborg
e723f02aa7 Remove empty line also for event handlers 2019-03-26 17:18:25 +01:00
Fabian Homborg
71a2337c5f Remove stray newlines in test
Sorry!
2019-03-26 17:18:25 +01:00
Fabian Homborg
39a601927f Remove useless empty lines from stack traces
This printed things like

```
in function 'f'
        called on standard input

in function 'd'
        called on standard input

in function 'b'
        called on standard input

in function 'a'
        called on standard input

```

As a first step, it removes the empty lines so it's now

```
in function 'f'
        called on standard input
in function 'd'
        called on standard input
in function 'b'
        called on standard input
in function 'a'
        called on standard input
```

See #5434.
2019-03-26 16:47:42 +01:00
Fabian Homborg
b86200938f Always use "." for cd
Nobody doesn't want to use $PWD to cd, so if $CDPATH does not include
it that was a mistake.

Bash also appends "." here.

Fixes #4484.
2019-03-26 10:11:36 +01:00
ridiculousfish
eeec6cc2fc Remove a single use of env_stack_t::principal 2019-03-25 02:27:02 -07:00
ridiculousfish
989f992a75 Rearrange and inline some env code 2019-03-25 00:49:52 -07:00
ridiculousfish
ea3a368c50 Make env_var_t store its values via shared_ptr
This switches env_var_t to be an immutable value type, and stores its
contents via a shared_ptr. This eliminates string copying when fetching
env_var_t values.
2019-03-25 00:41:04 -07:00
ridiculousfish
93d70fae11 Relnote stop buffering deferred function processes 2019-03-24 21:39:39 -07:00
ridiculousfish
5eade35257 Stop buffering deferred function processes
If a function process is deferred, allow it to be unbuffered.
This permits certain simple cases where functions are piped to external
commands to execute without buffering.

This is a somewhat-hacky stopgap measure that can't really be extended
to more general concurrent processes. However it is overall an improvement
in user experience that might help flush out some bugs too.
2019-03-24 21:23:26 -07:00
ridiculousfish
3bbee06248 Introduce the notion of a deferred process
In a job, a deferred process is the last fish internal process which pipes
to an external command. Execute the deferred process last; this will allow
for streaming its output.
2019-03-24 14:27:23 -07:00
ridiculousfish
165c82e68a Promote process_type_t to an enum class 2019-03-24 12:29:25 -07:00
ridiculousfish
96b8ac7013 Promote job_control_t to an enum class 2019-03-24 12:12:44 -07:00
Fabian Homborg
99d77c6049 docs: Replace &.arr; markup with unicode arrows
This is still missing the @cursor_keys bit.

See #5696.

[ci skip]
2019-03-24 20:03:52 +01:00
Fabian Homborg
848d538f08 docs: Replace @key markup with :kbd:
The best I could find. It doesn't currently appear to render in the
html, but it's better than showing `@key{thing}`.
2019-03-24 19:59:23 +01:00
Fabian Homborg
8837d17910 docs: Remove weird Commands subsection
This included another copy of the TOC in the middle of the index page
and called it "Commands"?

See #5696.

cc @ridiculousfish

[ci skip]
2019-03-24 19:51:27 +01:00
Fabian Homborg
295286b184 docs: Fix remaining "\subsection" markup
See #5696.

[ci skip]
2019-03-24 19:44:56 +01:00
Fabian Homborg
77e71cfcb1 completions/git: Handle AM files
Fixes #5763.

[ci skip]
2019-03-24 17:12:36 +01:00
Fabian Homborg
22d9382646 completions/service: Remove useless helper function
[ci skip]
2019-03-24 16:59:49 +01:00
Fabian Homborg
5afd1336e8 functions/fish_npm_helper: Use physical pwd
This searched for package.json in any parent, so just like finding
.git and .hg directories it _needs_ to use the physical pwd because
that's what git/hg/yarn use.

In general, if you do _any_ logic on $PWD, it should be the physical
path. Logical $PWD is basically only good for display and cd-ing
around with symlinks.

[ci skip]
2019-03-24 10:49:04 +01:00
ridiculousfish
b270ca8804 Merge branch 'input_cleanup'
This merges a bunch of changes that clean up how the reader loop and input
works.

Prior to this fix, we abused wchar_t by cramming readline functions into
"private" regions. Readline functions then were further abused with
meta-readline functions like R_NULL or R_TIMEOUT.

This fix introduces a new type char_event_type_t which wraps up the "meta"
character types. A char event may be a null (try again), timeout, readline,
or real input character. These are all distinct values.

The reader loop is then refactored to handle these cases separately.
2019-03-23 23:35:03 -07:00
ridiculousfish
71f26a6813 Remove INPUT_COMMON_BASE
We no longer store readline commands as characters, so there's no need to
reserve character space for them.
2019-03-23 23:31:37 -07:00
ridiculousfish
e7d7eff0ee Rename all readline commands to lowercase and remove R_ prefix 2019-03-23 23:31:35 -07:00
ridiculousfish
9187458d51 Continued refactoring of reader_data_t::readline 2019-03-23 23:31:34 -07:00
ridiculousfish
6ba94fd81b Factor readline command handling into new function handle_readline_command() 2019-03-23 23:31:33 -07:00
ridiculousfish
42f4d2bd86 Factor out the "read coalescing" part of reader_data_t::readline 2019-03-23 23:31:31 -07:00
ridiculousfish
7ae7865071 Factor reader_data_t::readline state into a new struct
Will help break up this monster.
2019-03-23 23:31:29 -07:00
ridiculousfish
6aba28ad3d Add missing cases to readline loop
Handle all readline commands in our switch.
2019-03-23 23:31:27 -07:00
ridiculousfish
2c56e27d37 Switch readline commands to readline_cmd_t enum class 2019-03-23 23:31:25 -07:00
ridiculousfish
0841072462 Minor cleanup of kill ring 2019-03-23 23:31:24 -07:00
ridiculousfish
b68d3b84de Switch input_function_get_code() to return maybe_t 2019-03-23 23:31:22 -07:00
ridiculousfish
c2be5e8986 Introduce char_event_type_t::readline
Baby steps towards eliminating readline actions as characters.
2019-03-23 23:31:18 -07:00
ridiculousfish
14663089c8 Finish removing R_NULL 2019-03-23 23:31:09 -07:00
ridiculousfish
28b79a2c88 Some further steps towards removing R_NULL
Introduce char_event_type_t::check_exit to represent "check for exit"
instead of R_NULL.
2019-03-23 23:31:01 -07:00
ridiculousfish
70a92a9710 Switch interrupt_handler to return maybe_t<char_event_t>
Prepares to remove R_NULL
2019-03-23 23:13:19 -07:00
ridiculousfish
1ef2404e1c readb to return char_event_t
Avoids some annoying type conversions.
2019-03-23 23:12:50 -07:00
ridiculousfish
46dfad52d9 Switch the input interrupt function to return maybe_t
Allow returning none() to mean do nothing.
2019-03-23 23:12:12 -07:00
ridiculousfish
1e5c1c82c7 Rename and simplify input_read_characters_eof_only
Clarify its role.
2019-03-23 23:11:45 -07:00
ridiculousfish
00f24695fe Remove R_EOF
Promote R_EOF to a new char_event_type_t instead of keeping it as a char
value.
2019-03-23 23:11:23 -07:00
ridiculousfish
185805641c Remove R_TIMEOUT
Promote timeout to a char_event_type_t, moving it out of the "char" namespace.
This will help simplify the readline implementation.
2019-03-23 20:10:06 -07:00
Aaron Gyes
a2a9709fd9 Don't truncate hostnames over 32 characters
I believe this was selected to be artificially low for the sake
of it displaying well in prompts. But people should expect to get
the same output as can be gotten from `hostname`.

Fixes #5758
2019-03-23 12:34:48 -07:00
Aaron Gyes
7a74198aa3 parser: try to avoid some strings being copied 2019-03-23 12:34:48 -07:00
Fabian Homborg
25ba16d4b6 functions/help: Cleanup 2019-03-22 12:48:26 +01:00
Fabian Homborg
4c61691377 functions/help: Don't eval to check for lynx
This called `eval $fish_browser --version` to figure out if it is
lynx.

That's really not worth it just to support edge-cases using a rather
unusual browser, to work around a bug in it.

Instead we just see if the browser name starts with "lynx", which
should work in 99.9% of cases.
2019-03-22 12:38:23 +01:00
Fabian Homborg
21c8be8cd1 functions/help: Use open command everywhere
See #5756.

[ci skip]
2019-03-22 09:09:57 +01:00
GReagle
277a94c118 FAQ: how to check whether variable is defined or not empty (#5732)
* FAQ: how to check whether variable is defined or not empty

* FAQ: how to check whether variable is not empty: include test in answer
2019-03-21 10:24:08 +01:00
Mahmoud Al-Qudsi
d467a1a145 Merge branch 'dynamic_wcwidth'
This merges in a number of improvements specifically aimed at console
sessions (i.e. using fish at the tty, not over SSH or in an X-based
terminal emulator). When a console session is detected, the system
wcwidth is used to line up width info between fish and the system tty,
and only simple characters are used as symbols.

Tested under Linux, macOS, FreeBSD, Solaris, Cygwin, WSL, and others.

Closes #5552. Ref #789, #3672.
2019-03-20 21:48:50 -05:00
Mahmoud Al-Qudsi
a1cba81d13 Add note about console session improvements to CHANGELOG 2019-03-20 21:47:34 -05:00
Mahmoud Al-Qudsi
c50cce298d Allow the omitted new line character to be more than one char
The code already allowed for variable width (multicell) *display* of the
newline omitted character, but there was no way to define it as being
more than one `wchar_t`.

This lets us use a string on console sessions (^J aka newline feed)
instead of an ambiguous character like `@` (used in some versions of
vim for ^M) or `~` (what we were using).
2019-03-20 21:47:34 -05:00
Mahmoud Al-Qudsi
753d489376 Fall back to simpler special characters in console sessions 2019-03-20 21:47:34 -05:00
Mahmoud Al-Qudsi
da8e343076 Use is_console_session() to signal using system wcwidth()
The system version of `wcwidth()` reflects the capabilities of the
system's own virtual terminal's view of the width of the character in
question, while fish's enhanced version (`widechar_wcwidth`) is much too
smart for most login terminals, which generally barely support anything
beyond ASCII text.

If, at startup, it is detected that we are running under a physical
console rather than within a terminal emulator running in a desktop
environment, take that as a hint to use the system-provided `wcwidth`.
2019-03-20 21:47:34 -05:00
Mahmoud Al-Qudsi
4aded78fc9 Add is_console_session() to detect physical vty 2019-03-20 21:47:32 -05:00
Mahmoud Al-Qudsi
f2896b2d83 Fix junk memory read introduced in 1cd5b2f4e1
The commit began passing the length of the wide string rather than the
length of the narrowed string after conversion via `wcstombs`. We *do*
have the actual length, but it's not (necessarily) the same as the
original value. We need to pass the result of `wcstombs` instead.
2019-03-20 20:51:22 -05:00
Fabian Homborg
a8b01e1c99 src/output: Unconst-cast tputs
Fixes the build on Solaris/OpenIndiana/Illumos.
2019-03-20 09:01:46 +01:00
Fabian Homborg
1a53bbeb9d src/fallback: Include locale.h for the wcstod_l fallback
Fixes #5753.
2019-03-20 08:54:40 +01:00
Fabian Homborg
f8b88d5b98 docs/fish_git_prompt: Better document variables
More accurate, also the code example can now be copy-pasted.

[ci skip]
2019-03-19 21:07:49 +01:00
Fabian Homborg
a649c5293e functions/fish_git_prompt: Fix space prefix for verbose showupstream
This created another local version of the variable just for the if-block.

Can't say I love the space prefix, but then I think we have too many
of these modes anyway.
2019-03-19 10:27:52 +01:00
Fabian Homborg
f6226f0802 functions/fish_git_prompt: Useful status for show_upstream
Returns 0 if there is no diversion, 1 otherwise.
2019-03-19 10:24:40 +01:00
Fabian Homborg
632c47be54 functions/fish_git_prompt: Remove literal tabs 2019-03-19 10:24:34 +01:00
Fabian Homborg
05ef157757 functions/fish_git_prompt: Let helper functions return useful status
If you use these to figure out if there _are_ staged files, or dirty
or whatever, you currently need to check the output, which relies on
the configured character.

Instead, we let them also return a useful status.
Notably, this is *not* simply the status of the git call.

__fish_git_prompt_X returns 0 if the repo is X.

This works for untracked, but the "diff" things return 1 if there is a
diff, so we invert the status for them.

See #5748.

[ci skip]
2019-03-19 10:11:37 +01:00
ykai
f56bce3f97 Fixed mount -o<TAB> exception 2019-03-19 09:28:14 +01:00
Fabian Homborg
805a8db7ef functions/fish_hg_prompt: Show untracked files
Apparently "status --quiet" actually inhibits showing untracked files,
which explains why it's 20% faster (though it's quite weird use of
that option!)

Fixes #5749.

[ci skip]
2019-03-18 22:26:43 +01:00
Fabian Homborg
69abbd7b2a docs: Mention $__fish_x_dir in autoloading chapter
That's what we want people to use instead of hardcoding
"/usr/share/fish", because that would break the code on other systems.

[ci skip]
2019-03-18 21:10:18 +01:00
ridiculousfish
03454b7dcd Use a real struct type in fish_indent pending node stack 2019-03-18 09:13:36 -07:00
ridiculousfish
a58662dd46 Make maybe_t conditionally copyable
This allows it to be used with both e.g. unique_ptr and std::vector.
2019-03-17 13:38:18 -07:00
Fabian Homborg
0bde698f81 printf: Don't die on incomplete conversions
POSIX dictates here that incomplete conversions, like in

    printf %d\n 15.2

or

    printf %d 14g

are still printed along with any error.

This seems alright, as it allows users to silence stderr to accept incomplete conversions.

This commit implements it, but what's a bit weird is the ordering between stdout and stderr,
causing the error to be printed _after_, like

    15
    14
    15.1: value not completely converted
    14,2: value not completely converted

but that seems like a general issue with how we buffer the streams.

(I know that nonfatal_error is a copy of most of fatal_error - I tried
differently, and va_* is weird)

Fixes #5532.
2019-03-17 17:00:55 +01:00
SanskritFritz
aea4062906 cower doesn't exist anymore, completions dropped 2019-03-17 10:55:01 +01:00
Aaron Gyes
6e525cc5d9 wcsfilecmp: sort - after everything else
Before this change, - was sorted with other punctuation before
A-Z. Now, it sorts above the rest of the characters.

This has a practical effect on completions, where when there are
both -s and --long with the same description, the short option
is now before the long option in the pager, which is what is now
selected when navigating `foo -<TAB>`. The long options can be
picked out with `foo --<TAB>`. Before, short options which
duplicated a long option literally could not be selected by
any means from the pager.

Fixes #5634
2019-03-16 01:31:56 -07:00
Aaron Gyes
74a22ff426 wcsfilecmp: punctuation [\]^_` after A-Z.
This tweaks wcsfilecmp such that certain punctuation characters will
come after A-Z.

A big win with `set <TAB>` - the __prefixed fish junk now comes
after the stuff users should care about.
2019-03-16 01:18:16 -07:00
ridiculousfish
88d20e257b Remove some unused variables 2019-03-15 20:21:05 -07:00
Fabian Homborg
0b6d6a29eb completions/git: Fix broken conditions for git config
Classic case of not seeing `and` as a new command:

`__fish_git_using_command config and anotherthing`

causes `and anotherthing` to be passed as arguments to
`__fish_git_using_command` instead of being executed.

[ci skip]
2019-03-15 20:09:55 +01:00
Fabian Homborg
a7ab8c6a4b Remove __fish_test_arg helper function
This was a remnant from before `string` existed, and was only used by
the xterm completions.

Part of #5279

[ci skip]
2019-03-15 19:58:01 +01:00
Fabian Homborg
2de3f7c686 Move ninja functions into ninja completions
Part of #5279

[ci skip]
2019-03-15 19:57:56 +01:00
Fabian Homborg
1c3c76165e Move xrandr functions into randr completions
Part of #5279.

[ci skip]
2019-03-15 19:57:51 +01:00
Fabian Homborg
a1380a736b Move __fish_print_make_targets into make completions
A function file for a function used only by one completion (and
unlikely to be used anywhere else).

If another user shows up, we can move it out again.

Part of #5279

[ci skip]
2019-03-15 19:57:46 +01:00
Fabian Homborg
9bd398b9fb Document features more
This adds string-replace-fewer-backslashes, but also explains the
feature flag system a bit more.

[ci skip]
2019-03-15 15:31:21 +01:00
Fabian Homborg
86e9e60ae7 completions/set: Fix set -eU
This had a typo where it completed `-u` variables. Only `-u` means
unexported, `-U` means universal.

[ci skip]
2019-03-15 15:22:59 +01:00
Fabian Homborg
ef2fe0dfa0 CHANGELOG string backslashes 2019-03-15 15:22:59 +01:00
Fabian Homborg
83932441bb Fix fish_clipboard_paste with string-replace-fewer-backslashes
This is the one place in fish where we use a `\` in the replacement of
a `string replace -r`, so we'll have to check the feature.
2019-03-15 15:18:19 +01:00
Fabian Homborg
864bb1f7a6 Add string-replace-fewer-backslashes feature
This disables an extra round of escaping in the `string replace -r`
replacement string.

Currently, to add a backslash to an a or b (to "escape" it):

    string replace -ra '([ab])' '\\\\\\\$1' a

7 backslashes!

This removes one of the layers, so now 3 or 4 works (each one escaped
for the single-quotes, so pcre receives two, which it reads as one literal):

    string replace -ra '([ab])' '\\\\$1' a

This is backwards-incompatible as replacement strings will change
meaning, so we put it behind a feature flag.

The name is kinda crappy, though.

Fixes #5474.
2019-03-15 15:18:19 +01:00
Fabian Homborg
a7a12c5c96 Merge pull request #5709 from zabereer/prompts_with_pipestatus
Prompts with pipestatus
2019-03-15 14:32:33 +01:00
Fabian Homborg
b3f39096e7 CHANGELOG count from stdin
[ci skip]
2019-03-15 14:31:36 +01:00
Fabian Homborg
18d7123ff4 fish_git_prompt: Use count from stdin
Removes any uses of `wc` in our codebase.
2019-03-15 14:31:36 +01:00
Fabian Homborg
e7a964fdfa [count] Allow counting lines from stdin
As a simple replacement for `wc -l`.

This counts both lines on stdin _and_ arguments.

So if "file" has three lines, then `count a b c < file` will print 6.

And since it counts newlines, like wc, `echo -n foo | count` prints 0.
2019-03-15 14:31:36 +01:00
Aaron Gyes
cb36a9ca36 builtin.cpp: ensure builtin_get_desc returns something initialized 2019-03-14 21:45:31 -07:00
Aaron Gyes
9a5022514f builtin_argparse: use std::swap 2019-03-14 16:47:23 -07:00
Aaron Gyes
d837eee09d remove some wcstring -> wchar_t* -> wcstring conversions
Mostly related to usage _(L"foo"), keeping in mind the _
macro does a wcstring().c_str() already.

And a smattering of other trivial micro-optimizations certain
to not help tangibly.
2019-03-14 15:21:08 -07:00
Fabian Homborg
4a67d9015b docs/command: Make it clearer that -a needs a commandname
Fixes #5107.

[ci skip]
2019-03-14 21:07:10 +01:00
Aaron Gyes
477b2e8d7c std::vector<wcstring> is wcstring_list_t 2019-03-14 11:17:26 -07:00
Aaron Gyes
0ee9862809 Write out backtrace in one debug(), add \n after it.
The goal here is to make fish -dn -Dn output a little easier
to scan visually.
2019-03-14 10:56:24 -07:00
Aaron Gyes
cf570d4b11 fixup previous commit 2019-03-14 10:37:13 -07:00
Aaron Gyes
2636876472 simplify append_yaml_to_buffer 2019-03-14 10:29:16 -07:00
Aaron Gyes
2bf554ae5e Simplify valid_var_name 2019-03-14 10:29:16 -07:00
Fabian Homborg
9dcb5abaf1 completions/pandoc: Stringify
This should be the last call to `grep` outside of a script
specifically related to `grep`.

(With the exception of `zpool`, which I've already written, but which
will probably be merged later)
2019-03-14 17:16:47 +01:00
Fabian Homborg
605b1cfab6 README: Update deps
- Remove `jq` since it can also use python now.

- Add specific UNIX utilities

Fixes #5553.

[ci skip]
2019-03-14 13:31:34 +01:00
Fabian Homborg
7766d0a7d0 Remove outdated comment
[ci skip]
2019-03-14 13:23:48 +01:00
Fabian Homborg
912ba177ec functions/__fish_append: Stringify
This called `sed`, twice.
2019-03-14 13:23:48 +01:00
Fabian Homborg
05038fc865 completions/zfs: Stringify 2019-03-14 13:23:47 +01:00
Fabian Homborg
aa08504fe3 completions/zpool: Stringify a bit
These are the simple bits - replace useless helper functions and uses
of grep/sed with string or other appropriate tools.
2019-03-14 13:23:47 +01:00
Fabian Homborg
a4d728c9de completions/ezjail-admin: Stringify
Specifically `grep`, these awks are still a bit too annoying to do
with `string`.
2019-03-14 13:23:47 +01:00
Fabian Homborg
3043d726bf completions/minikube: Stringify 2019-03-14 13:23:47 +01:00
Fabian Homborg
c5d5089871 fish_svn_prompt: Stringify
This was the only remaining use of `grep` in functions/.
2019-03-14 13:23:47 +01:00
Fabian Homborg
5859d205d8 completions/apt-file: Remove ls call 2019-03-14 13:23:47 +01:00
Fabian Homborg
7784a5f23c __fish_describe_command: Remove awk
This is really the only important place we're using it.

See #5553.
2019-03-14 13:23:47 +01:00
Fabian Homborg
29556efebd Drop rc.d completions
This was an arch utility that it used shortly before introducing
systemd.

It's been dropped upstream for years.
2019-03-14 13:23:47 +01:00
Fabian Homborg
f798a02a2a Remove unused variable 2019-03-14 13:23:47 +01:00
Aaron Gyes
6fc542dfca Revert "simplify append_yaml_to_buffer"
This reverts commit f0998fed6a.
2019-03-13 14:05:23 -07:00
Aaron Gyes
f0998fed6a simplify append_yaml_to_buffer 2019-03-13 13:52:11 -07:00
Aaron Gyes
b879a2650c Fix 32-bit build
Fixes #5740
2019-03-13 07:44:05 -07:00
Fabian Homborg
05b9c07816 wcwidth: Return 0 for median/final jamo
Fixes #5729.
2019-03-13 12:39:08 +01:00
Fabian Homborg
028112e535 CHANGELOG: Add "scripting improvements" paragraph
It felt weird to put `math --scale` under "interactive", and it's not
a syntax change, new command or particularly notable either.
2019-03-13 12:39:08 +01:00
Fabian Homborg
b792290c51 CHANGELOG pasting leading spaces 2019-03-13 12:39:08 +01:00
Fabian Homborg
a5a643f854 Bracketed paste: Strip leading spaces if they'd trigger histignore
Similar to the last commit, only for the in-terminal-paste stuff.

Also cleans up the comments on bracketed paste a bit - nobody has
stepped forward to report problems with old emacsen or windows, so
there's no need for a TODO comment.

See #4327.
2019-03-13 12:39:08 +01:00
Fabian Homborg
ad0c8cfb83 fish_clipboard_paste: Don't add histignore spaces
If we're at the beginning of the commandline, we trim leading whitespace so we don't trigger histignore.

Since that's the main issue of problems with histignore:
Closes #4327.
2019-03-13 12:39:08 +01:00
Fabian Homborg
5a9d153363 input: Use range-for
Also adds a couple of consts.
2019-03-13 12:39:08 +01:00
hyperfekt
51cc03ca75 reflect #1912 in documentation 2019-03-13 10:10:38 +01:00
Aaron Gyes
f92c2921d2 Remove mini() and maxi()
C++11 provides std::min/std::max which we're using all over,
obviating the need for our own templates for this.

util.h now only provides two things: get_time and wcsfilecmp.
This commit removes everything that includes it which doesn't
use either; most because they no longer need mini or maxi from
it but some others were #including it unnecessarily.
2019-03-12 23:25:15 -07:00
Fabian Homborg
b318ab17d2 wcwidth: Classify some Hangul Jamo as combiners
Hangul uses three codepoints to combine to one glyph. The first has a
width of 2 (like the final glyph), but the second and third were
assigned a width of 1, which seems to match EastAsianWidth.txt:

> 1160..11FF;N # Lo [160] HANGUL JUNGSEONG FILLER..HANGUL JONGSEONG SSANGNIEUN

Instead, we override that and treat the middle and end codepoint as combiners,
always, because there's no way to figure out what the terminal will
think and that's the way it's supposed to work.

If they stand by themselves or in another combination, they'll indeed
show up with a width of 1 so we'll get it wrong, but that's less
likely and not expressible with wcwidth().

Fixes #5729.
2019-03-12 23:42:50 +01:00
Aaron Gyes
2e4948e1f4 Fix switch nesting in handler_matches
I guess this worked, but whoops.
2019-03-12 15:27:13 -07:00
Aaron Gyes
b7c069a765 Remove two duplicated #includes 2019-03-12 15:09:36 -07:00
Aaron Gyes
aaacdb89b6 Switches over to cstring from string.h. 2019-03-12 15:09:36 -07:00
Aaron Gyes
d5ac239f68 This commit changes wchar.h includes to cwchar, and uses std::
for everything it provides.
2019-03-12 15:09:36 -07:00
Fabian Homborg
ecfe4acd0c complete: Do fuzzy match for --do-complete
This only did prefix matching, which is generally less useful.

All existing users _should_ be okay with this since they want to
provide completions.

Fixes #5467.
Fixes #2318.
2019-03-12 20:27:20 +01:00
Fabian Homborg
bfb61879cd Do create installation directories that already exist
Reverts 71329a250b.

That tried to fix problems with pkgconfig by not recreating it.
Instead, use the function we already have for not trying too hard to
create a directory.

Fixes #5735.
2019-03-12 18:50:45 +01:00
hyperfekt
8a0d794337 fish_git_prompt: optionally show stash state in informative mode 2019-03-12 18:47:28 +01:00
Aaron Gyes
66887ca4bc Fix OpenSUSE build
They treat -Wreturn-type as a critical thing apparently.
2019-03-12 09:45:39 -07:00
Aaron Gyes
2ae6e5a585 Explicitly handle all enum values in more switch statements
This addresses a few places where -Wswitch-enum showed one or two missing
case's for enum values.

It did uncover and fix one apparent oversight:

$ function asd -p 100
   echo foo
end

$ functions --handlers-type exit
Event exit
asd

It looks like this should be showing a PID before 'asd' just like
job_exit handlers show the job id. It was falling
through to default: which just printed the function name.

$ functions --handlers-type exit
Event exit
100 asd
2019-03-11 15:02:18 -07:00
Aaron Gyes
3e8c05e32b cat, mv, rm completions: shorten descriptions 2019-03-09 15:02:25 -08:00
Aaron Gyes
c1859b5678 date completions: show correct options for different BSDs, macOS
Also prevents file completions where they are not approprite, and
additionally shortened the descriptions to fit in two pager columns
in an 80-wide terminal for some platforms.
2019-03-09 14:56:25 -08:00
Aaron Gyes
eaf496c1d4 seq.fish: use gseq if available.
Apparently if you install gnu coreutils on OpenBSD, the tools are
g-prefixed. So we definitely want to just alias that rather than
provide our lousy shell script implementation.
2019-03-09 13:44:03 -08:00
Fabian Homborg
ba1249763b functions/__fish_npm_helper: Use python for json
[ci skip]
2019-03-09 18:30:17 +01:00
Fabian Homborg
bf926fd6c4 completions/yarn: Don't offer files for yarn run
Pretty sure that, like npm, that's not valid.

[ci skip]
2019-03-09 18:04:21 +01:00
Fabian Homborg
b0e9405b11 Read json via python
Apparently that's actually faster than jq, and it's more likely to be
installed.

Also it should convince the arch packager to remove the jq dependency.

The indentation is weird, though.

[ci skip]
2019-03-09 18:04:21 +01:00
Fabian Homborg
9b1fb6938e Add __fish_anypython helper function
This just finds the first usable python and echos it, so it can then
be used.

We have a few places where we use it and I'm about to add some more.
2019-03-09 18:04:21 +01:00
Aaron Gyes
3ac1c29f79 cp completions: shorten descriptions
Enough to fit two pager columns into a 80-wide terminal.
2019-03-09 07:55:46 -08:00
Aaron Gyes
5938f02db1 Update CHANGELOG.md 2019-03-09 07:41:46 -08:00
Aaron Gyes
7ececa4c69 dmesg completions for all the platforms
+ tweaks for Linux: shorter descriptions, suppress file completions
+ Add correct completions for macOS, NetBSD, FreeBSD, OpenBSD, DragonFly
+ Solaris dmesg has no options, so complete nothing there
2019-03-09 07:29:23 -08:00
Fabian Homborg
62526a3ac8 completions/git: Fix relative paths for older git
If the first file presented was in the current directory, this would
error out.

Fixes #5728.

[ci skip]
2019-03-08 16:03:57 +01:00
Fabian Homborg
49ba7f8c01 Update CHANGELOG 2019-03-07 22:50:18 +01:00
Fabian Homborg
bd5232e0e2 functions/seq: Fix negative numbers
25d83ed0d7 (included in 3.0.0) added a `string` check that
did not use `--`, so negative numbers were interpreted as options.

Apparently nobody is using this.

(Again, this is for the `seq` fallback used on OpenBSD)
2019-03-07 22:50:17 +01:00
Aaron Gyes
e35a30de0a Add NSAppleEventsUsageDescription
This is required to send Apple Events when built against the 10.14
SDK.

Fixes #5727
2019-03-07 12:01:53 -08:00
Fabian Homborg
b5b0e68044 functions/seq: Stop using bc in the fallback
Just to remove the dependency - performance is probably about the
same.

This is used, AFAICT, exclusively on OpenBSD (not Free or Net).

CC @zanchey.
2019-03-07 14:04:32 +01:00
Fabian Homborg
1cd5b2f4e1 Pass string length instead of recomputing
This called `writestr(char*)`, which then just called `writestr(char*,
strlen(char*))`, when it had the string length right there!
2019-03-07 10:04:18 +01:00
Fabian Homborg
2b0b3d3193 Outputter_t: Handle C locale like everything else
This tried to skip conversion if the locale had MB_CUR_MAX == 1, but
in doing so it just entered an infinite recursion (because
writestr(wchar_t*) called writestr(wchar_t*)).

Instead, just let wcstombs handle it.

Fixes #5724.
2019-03-07 10:04:18 +01:00
Aaron Gyes
91e70e38e7 Handle TERM_PROGRAM_VERSION with junk after the number.
We only care about the major version number.

Fixes #5725
2019-03-06 13:52:54 -08:00
Fabian Homborg
c633c06e11 Guess emoji width via system wcwidth
Since Unicode 9, the width of some characters changed to 2.

Depending on the system, it might have support for it, or it might
not.

Instead of hardcoding specific glibc etc versions, we check what the
system wcwidth says to "😃", U+1F603 "Grinning Face With Big Eyes".

The intention is to, in most cases, make setting $fish_emoji_width
unnecessary, but since it sets the "guessed_emoji_width", that variable still takes precedence if it is set.

Unfortunately this approach has some caveats:

- It relies on the locale being set to a unicode-supporting one.
  (C.UTF-8 is unfortunately not standard, so we can't use it)
- It relies on the terminal's wcwidth having unicode9 support IFF the
  system wcwidth does.

This is like #5722, but at runtime.

The additional caveat is that we don't try to achieve a unicode
locale, but since we re-run the heuristic when the locale changes (and
we try to get a unicode locale), we should still often get the correct
value.

Plus if you use a C locale and your terminal still displays emoji,
you've misconfigured your system.

Fixes #5722.
2019-03-06 22:27:21 +01:00
Fabian Homborg
60ce10ad84 functions/eval: Return 0 for empty arguments
Fixes #5692.
2019-03-05 21:10:11 +01:00
Fabian Homborg
eac9ec9093 Add vagrant completions
These aren't perfect, but the tool is pretty much hostile to proper
completions - it includes a "--machine-readable" option, but `vagrant
global-status --machine-readable` prints great output like

```
1551816037,,ui,info,id
1551816037,,ui,info,name
1551816037,,ui,info,provider
1551816037,,ui,info,state
1551816037,,ui,info,directory
1551816037,,ui,info,
1551816037,,ui,info,-------------------------------------------------------------------------
1551816037,,ui,info,d3ea265
1551816037,,ui,info,default
1551816037,,ui,info,virtualbox
1551816037,,ui,info,poweroff
1551816037,,ui,info,/home/alfa/dev/oi-userland
1551816037,,ui,info,
1551816037,,ui,info,fdf42c4
1551816037,,ui,info,default
1551816037,,ui,info,virtualbox
1551816037,,ui,info,poweroff
1551816037,,ui,info,/home/alfa/dev/vagrant/NetBSD
1551816037,,ui,info,
1551816037,,ui,info,f8f6eff
1551816037,,ui,info,default
1551816037,,ui,info,virtualbox
1551816037,,ui,info,poweroff
1551816037,,ui,info,/home/alfa/dev/vagrant/fedora
1551816037,,ui,info,
1551816037,,ui,info, \nThe above shows information about all known Vagrant environments\non this machine. This data is cached and may not be completely\nup-to-date (use "vagrant global-status --prune" to prune invalid\nentries). To interact with any of the machines%!(VAGRANT_COMMA) you can go to that\ndirectory and run Vagrant%!(VAGRANT_COMMA) or you can use the ID directly with\nVagrant commands from any directory. For example:\n"vagrant destroy 1a2b3c4d"
```

and still takes 500ms to do so. The actual information is in a json
file, which we can't expect to read, and it doesn't have linebreaks or
such which we could use to hack-parse it.

So this is the best we can do for the most important bits (the
machineids), so let's just add this as-is.

[ci skip]
2019-03-05 21:02:32 +01:00
zabereer
a634356bcc remove redundant comment from __fish_print_pipestatus.fish 2019-03-05 18:25:16 +00:00
zabereer
d71e39f756 Revert "use global variables for $pipestatus in prompts to allow users to customize the look"
This reverts commit d5c18350a7.
2019-03-05 18:19:57 +00:00
Fabian Homborg
60f162db19 Remove single-argument test
This is an awful bit of `test` functionality that only exists to have
a clever shortcut and confuse people.

[ci skip]
2019-03-05 17:57:50 +01:00
Fabian Homborg
fe029d4d27 CHANGELOG: Remove reverted fix for read in fish_title
11009de431 reverted
b247c8d9ad because it did not work.

[ci skip]
2019-03-05 10:44:11 +01:00
David Adam
b443808452 event.cpp: die if invalid event type passed
Fixes the build with -Wreturn-type.
2019-03-05 07:27:56 +08:00
zabereer
da2925bad7 add $pipestatus to classic_vcs.fish prompt 2019-03-04 18:25:18 +00:00
zabereer
0923712e3e add $pipestatus to informative_vcs.fish prompt 2019-03-04 18:15:04 +00:00
David Adam
08fd8b6472 cmake: fix prebuilt documentation detection and installation 2019-03-04 22:06:09 +08:00
ridiculousfish
89a7cc5da3 Switch s_write to accepting const vector & instead of raw pointers 2019-03-03 18:49:57 -08:00
ridiculousfish
ccbc9d57f2 Remove reader_data_t::next
It's no longer used
2019-03-03 18:14:41 -08:00
ridiculousfish
9b9c1aa745 Fix some unused variable warnings 2019-03-03 18:06:31 -08:00
ridiculousfish
717ac9a8d5 Switch highlight_spec_t to a struct
Rather than a janky bitmask, use a real struct with real fields.
2019-03-03 18:04:22 -08:00
ridiculousfish
d165d1df27 Remove highlight_modifier_sloppy_background
It's no longer ever set
2019-03-03 17:56:08 -08:00
ridiculousfish
43a11af5e4 Reorganize reader.cpp to separate te current_data users from reader_data_t 2019-03-03 15:49:56 -08:00
ridiculousfish
c09544b288 Migrate more functions to instance methods on reader_data_t 2019-03-03 15:10:47 -08:00
ridiculousfish
29db076f4a exec_prompt to be an instance method on reader_data_t 2019-03-03 14:38:53 -08:00
ridiculousfish
7ff4b5e5fe Switch highlighting to instance methods on reader_data_t 2019-03-03 14:34:52 -08:00
ridiculousfish
e477b99a8b Switch more autosuggestions to instance methods on reader_data_t 2019-03-03 14:30:32 -08:00
ridiculousfish
b014c327a2 reader_data_t to become enable_shared_from_this
For background operations such as autosuggestions, we need a way for the
completion handler to keep the reader_data alive.
2019-03-03 14:21:15 -08:00
ridiculousfish
c334a41f96 Switch accept_autosuggestion to an instance method on reader_data_t 2019-03-03 14:11:09 -08:00
ridiculousfish
d7a156e7d9 Switch clear_pager to an instance method on reader_data_t 2019-03-03 14:09:23 -08:00
ridiculousfish
164c5b1c18 Migrate a lot of free functions in reader into reader_data_t 2019-03-03 14:02:27 -08:00
ridiculousfish
ecf51b575e Clean up input initialization and destruction 2019-03-03 12:59:55 -08:00
ridiculousfish
dc1073f905 reader_set_buffer_maintaining_pager to take reader_data directly 2019-03-03 12:19:46 -08:00
ridiculousfish
0bc08c6197 highlight_search to take reader_data directly 2019-03-03 12:11:32 -08:00
ridiculousfish
b07345ed18 set_command_line_and_position to take reader_data directly 2019-03-03 12:07:51 -08:00
ridiculousfish
968152ddc7 clear_pager to accept reader_data directly 2019-03-03 12:00:09 -08:00
ridiculousfish
e11c3f352f Clean up handle_child_status
Now that we only call waitpid() on specific processes, we no longer need
to search to find the process returned by waitpid.
2019-03-03 11:47:32 -08:00
radek-sprta
261d48367d Add completions for Mariner (#5718)
* Add completions for Mariner

* Remove unnecessary characters
2019-03-03 20:25:31 +01:00
Fabian Homborg
8939a7ba7a completions/ipset: Don't error on loading
`ipset list --name` is a privileged operation, and it prints an
"Operation not permitted" error when done as a normal user.

What's worse, this did it on loading (the command substitution wasn't
quoted), so we'd print the error as soon as you did `ipset `.

Only do the operation when necessary, and don't print the error.

This'll effectively only make it work for root shells (not e.g. `sudo
ipset`), but I don't want to sprinkle `sudo` in the completion.

(Also why does listing stuff require root? That's not how it works
e.g. for ips. But I don't actually know what ipset is for, so maybe
there is a good reason.)

[ci skip]
2019-03-03 12:43:05 +01:00
ridiculousfish
dac5d79059 Switch wait command to use topics
Prior to this fix, the wait command used waitpid() directly. Switch it to
calling process_mark_finished_children() along with the rest of the job
machinery. This centralizes the waitpid call to a single location.
2019-03-02 16:58:27 -08:00
ridiculousfish
dc27de8190 Rename reader_interrupted to reader_test_and_clear_interrupted 2019-03-02 15:17:00 -08:00
zabereer
d5c18350a7 use global variables for $pipestatus in prompts to allow users to customize the look 2019-03-01 19:55:28 +00:00
David Adam
637503cb0a travis: drop superfluous CXXFLAGS on macOS
These have not been required since ASan was moved back to the Linux build.
2019-02-28 21:09:03 +08:00
David Adam
83b4adffc0 make_pkg: get static version if git is not available 2019-02-28 21:08:02 +08:00
David Adam
73d9f80772 cmake: drop obsolete paths for prebuilt documentation 2019-02-28 22:04:54 +11:00
David Adam
9acfe0261b cmake: install system manpath manpages
The build path of these files moved under Sphinx.
2019-02-28 22:03:57 +11:00
David Adam
d0394fd301 configure/Makefile.in: drop Autotools build
Removes the autoconf-based build system and its artefacts, updates git metadata and removes the
autoconf-based build from the README.
2019-02-28 22:03:57 +11:00
zabereer
e157ba131b add $pipestatus to informative.fish prompt 2019-02-28 06:37:56 +00:00
zabereer
ead26881f0 create __fish_print_pipestatus function to reduce code duplication in other prompts when adding $pipestatus 2019-02-28 06:19:28 +00:00
zabereer
8ebbe67ff1 Use string match instead of for loop to simplify classic_status.fish 2019-02-27 06:11:03 +00:00
zabereer
a6f9140963 remove redundant echo from __fish_pipestatus_with_signal.fish 2019-02-27 05:39:17 +00:00
zabereer
378b5d7295 update classic_status.fish prompt to include $pipestatus 2019-02-26 18:27:59 +00:00
zabereer
0071ad0409 add __fish_status_to_signal.fish and __fish_pipestatus_with_signal.fish 2019-02-26 18:09:37 +00:00
wyahiro
65d4f1b74e Format CHANGELOG.md 2019-01-21 16:36:29 +09:00
takoyaki9n
db671e8518 Merge branch 'master' into ant_completion 2019-01-21 16:32:51 +09:00
wyahiro
9a7079190d change validation of buildfile 2019-01-18 10:24:14 +09:00
wyahiro
2c52c5285d Fix fail back value for XDG_CACHE_HOME 2019-01-17 16:32:57 +09:00
wyahiro
71f15f70ea Fixed logic for cache file generation 2019-01-14 13:08:29 +09:00
wyahiro
480e95147c use cache file for ant targets 2019-01-13 21:36:05 +09:00
wyahiro
078907ef9d update CHANGELOG 2019-01-03 23:59:56 +09:00
wyahiro
48ed82b3f3 Update CHANGELOG.md 2019-01-03 23:33:21 +09:00
wyahiro
a6062c4cdd improved completion for ant 2019-01-03 23:17:53 +09:00
1048 changed files with 69370 additions and 80019 deletions

View File

@@ -5,6 +5,7 @@ packages:
- ncurses-dev
- pcre2-dev
- expect
- python
sources:
- https://git.sr.ht/~faho/fish
tasks:

View File

@@ -3,6 +3,7 @@ packages:
- cmake
- ninja
- expect
- python
sources:
- https://git.sr.ht/~faho/fish
tasks:

View File

@@ -7,6 +7,7 @@ packages:
- cmake
- gmake
- pcre2
- python
sources:
- https://git.sr.ht/~faho/fish
tasks:

View File

@@ -1,23 +0,0 @@
image: netbsd/latest
packages:
- ncurses
- gettext
- tcl-expect
- cmake
- gmake
- pcre2
tasks:
- build: |
git -c http.sslVerify=false clone https://git.sr.ht/~faho/fish
cd fish
mkdir build || :
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_DATADIR=share \
-DCMAKE_INSTALL_DOCDIR=share/doc/fish \
-DCMAKE_INSTALL_SYSCONFDIR=/etc
gmake -j2
- test: |
cd fish/build
gmake test SHOW_INTERACTIVE_LOG=1

View File

@@ -6,5 +6,11 @@
BasedOnStyle: Google
ColumnLimit: 100
IndentWidth: 4
# Place config.h first always.
IncludeCategories:
- Regex: '^"config.h"'
Priority: -1
# We don't want OCLint pragmas to be reformatted.
CommentPragmas: '^!OCLINT'

View File

@@ -12,7 +12,7 @@ max_line_length = 100
[{Makefile,*.in}]
indent_style = tab
[*.md]
[*.{md,rst}]
trim_trailing_whitespace = false
[*.{sh,ac}]

4
.gitattributes vendored
View File

@@ -25,10 +25,6 @@
# for linguist; let github identify our project as C++ instead of C due to pcre2
/pcre2-10.32/* linguist-vendored
install-sh linguist-vendored
config.sub linguist-vendored
config.guess linguist-vendored
/m4/* linguist-vendored
angular.js linguist-vendored
/doc_src/* linguist-documentation
*.fish linguist-language=fish

View File

@@ -11,7 +11,4 @@ Please tell us if you tried fish without third-party customizations by executing
sh -c 'env HOME=$(mktemp -d) fish'
Tell us how to reproduce the problem. Including an asciinema.org recording is useful for problems that involve the visual display of fish output such as its prompt.
If you are reporting a bug in fish 3.0, please make sure to indicate whether or not this is a
regression from fish 2.7.1.
-->

14
.gitignore vendored
View File

@@ -38,16 +38,6 @@ Desktop.ini
Thumbs.db
ehthumbs.db
# These file names can appear anywhere in the hierarchy. They tend to be OS
# or build system artifacts.
autom4te.cache
aclocal.m4
Makefile
config.h
config.cache
config.h.in
config.status
messages.pot
.directory
.fuse_hidden*
@@ -55,7 +45,6 @@ messages.pot
# Directories that only contain transitory files from building and testing.
/doc/
/obj/
/share/man/
/share/doc/
/test/
@@ -67,8 +56,6 @@ messages.pot
/command_list.txt
/command_list_toc.txt
/compile_commands.json
/confdefs.h
/configure
/doc.h
/fish
/fish.pc
@@ -85,7 +72,6 @@ fish-build-version-witness.txt
# from building and testing.
/doc_src/commands.hdr
/doc_src/index.hdr
/pcre2-*/configure.lineno
/po/*.gmo
/share/__fish_build_paths.fish
/share/pkgconfig

View File

@@ -13,6 +13,10 @@ matrix:
- gettext
- libncurses5-dev
- libpcre2-dev
- python
env:
# Some warnings upgraded to errors to match Open Build Service platforms
- CXXFLAGS="-Werror=address -Werror=return-type"
- os: linux
compiler: gcc
addons:
@@ -22,12 +26,13 @@ matrix:
- gettext
- lib32ncurses5-dev
- g++-multilib
- python
env:
- CXXFLAGS="-g -O2 -m32" CFLAGS="-g -m32"
- CXXFLAGS="-m32 -Werror=address -Werror=return-type" CFLAGS="-m32"
- os: linux
compiler: clang
env:
- CXXFLAGS="-g -O2 -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address"
- CXXFLAGS="-fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address"
- ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1
- UBSAN_OPTIONS=print_stacktrace=1:report_error_type=1:suppressions=$TRAVIS_BUILD_DIR/build_tools/ubsan.blacklist
addons:
@@ -37,12 +42,23 @@ matrix:
- gettext
- libncurses5-dev
- libpcre2-dev
- python
- os: linux
compiler: clang
env:
- CXXFLAGS="-fsanitize=thread"
addons:
apt:
packages:
- expect
- gettext
- libncurses5-dev
- libpcre2-dev
- python
- os: osx
before_install:
- brew update
- brew install pcre2 # use system PCRE2
env:
- CXXFLAGS="-g -O2 -lstdc++"
fast_finish: true
script:

View File

@@ -1,32 +1,215 @@
# fish next-minor
# fish 3.1b1 (released January 26, 2020)
## Deprecations
- The vcs-prompt functions have been renamed to names without double-underscore, so __fish_git_prompt is now fish_git_prompt, __fish_vcs_prompt is now fish_vcs_prompt, __fish_hg_prompt is now fish_hg_prompt and __fish_svn_prompt is now fish_svn_prompt. Shims at the old names have been added, and the variables have kept their old names (#5586).
## Notable fixes and improvements
- Fixed infinite recursion triggered if a custom `fish_title` function calls `read` interactively
- Add `$pipestatus` support
- `string split0` now returns 0 if it split something (#5701).
## Notable improvements and fixes
- A new `$pipestatus` variable contains a list of exit statuses of the previous job, for each of the separate commands in a pipeline (#5632).
- fish no longer buffers pipes to the last function in a pipeline, improving many cases where pipes appeared to block or hang (#1396).
- An overhaul of error messages for builtin commands, including a removal of the overwhelming usage summary, more readable stack traces (#3404, #5434), and stack traces for `test` (aka `[`) (#5771).
- fish's debugging arguments have been significantly improved. The `--debug-level` option has been removed, and a new `--debug` option replaces it. This option accepts various categories, which may be listed via `fish --print-debug-categories` (#5879). A new `--debug-output` option allows for redirection of debug output.
- `string` has a new `collect` subcommand for use in command substitutions, producing a single output instead of splitting on new lines (similar to `"$(cmd)"` in other shells) (#159).
- The fish manual, tutorial and FAQ are now available in `man` format as `fish-doc`, `fish-tutorial` and `fish-faq` respectively (#5521).
- Like other shells, `cd` now always looks for its argument in the current directory as a last resort, even if the `CDPATH` variable does not include it or "." (#4484).
- fish now correctly handles `CDPATH` entries that start with `..` (#6220) or contain `./` (#5887).
- The `fish_trace` variable may be set to trace execution (#3427). This performs a similar role as `set -x` in other shells.
- fish uses the temporary directory determined by the system, rather than relying on `/tmp` (#3845).
- The fish Web configuration tool (`fish_config`) prints a list of commands it is executing, to help understanding and debugging (#5584).
- Major performance improvements when pasting (#5866), executing lots of commands (#5905), importing history from bash (#6295), and when completing variables that might match `$history` (#6288).
### Syntax changes and new commands
- None yet.
- A new builtin command, `time`, which allows timing of fish functions and builtins as well as external commands (#117).
- Brace expansion now only takes place if the braces include a "," or a variable expansion, meaning common commands such as `git reset HEAD@{0}` do not require escaping (#5869).
- New redirections `&>` and `&|` may be used to redirect or pipe stdout, and also redirect stderr to stdout (#6192).
- `switch` now allows arguments that expand to nothing, like empty variables (#5677).
- The `VAR=val cmd` syntax can now be used to run a command in a modified environment (#6287).
- `and` is no longer recognised as a command, so that nonsensical constructs like `and and and` produce a syntax error (#6089).
- `math`'s exponent operator, '`^`', was previously left-associative, but now uses the more commonly-used right-associative behaviour (#6280). This means that `math '3^0.5^2'` was previously calculated as '(3^0.5)^2', but is now calculated as '3^(0.5^2)'.
- In fish 3.0, the variable used with `for` loops inside command substitutions could leak into enclosing scopes; this was an inadvertent behaviour change and has been reverted (#6480).
### Scripting improvements
- `string split0` now returns 0 if it split something (#5701).
- In the interest of consistency, `builtin -q` and `command -q` can now be used to query if a builtin or command exists (#5631).
- `math` now accepts `--scale=max` for the maximum scale (#5579).
- `builtin $var` now works correctly, allowing a variable as the builtin name (#5639).
- `cd` understands the `--` argument to make it possible to change to directories starting with a hyphen (#6071).
- `complete --do-complete` now also does fuzzy matches (#5467).
- `complete --do-complete` can be used inside completions, allowing limited recursion (#3474).
- `count` now also counts lines fed on standard input (#5744).
- `eval` produces an exit status of 0 when given no arguments, like other shells (#5692).
- `printf` prints what it can when input hasn't been fully converted to a number, but still prints an error (#5532).
- `complete -C foo` now works as expected, rather than requiring `complete -Cfoo`.
- `complete` has a new `--force-files` option, to re-enable file completions. This allows `sudo -E` and `pacman -Qo` to complete correctly (#5646).
- `argparse` now defaults to showing the current function name (instead of `argparse`) in its errors, making `--name` often superfluous (#5835).
- `argparse` has a new `--ignore-unknown` option to keep unrecognized options, allowing multiple argparse passes to parse options (#5367).
- `argparse` correctly handles flag value validation of options that only have short names (#5864).
- `read -S` (short option of `--shell`) is recognised correctly (#5660).
- `read` understands `--list`, which acts like `--array` in reading all arguments into a list inside a single variable, but is better named (#5846).
- `read` has a new option, `--tokenize`, which splits a string into variables according to the shell's tokenization rules, considering quoting, escaping, and so on (#3823).
- `read` interacts more correctly with the deprecated `$IFS` variable, in particular removing multiple separators when splitting a variable into a list (#6406), matching other shells.
- `fish_indent` now handles semicolons better, including leaving them in place for `; and` and `; or` instead of breaking the line (#5859).
- `fish_indent --write` now supports multiple file arguments, indenting them in turn.
- The default read limit has been increased to 100MiB (#5267).
- `math` now also understands `x` for multiplication, provided it is followed by whitespace (#5906).
- `math` reports the right error when incorrect syntax is used inside parentheses (#6063), and warns when unsupported logical operations are used (#6096).
- `functions --erase` now also prevents fish from autoloading a function for the first time (#5951).
- `jobs --last` returns 0 to indicate success when a job is found (#6104).
- `commandline -p` and `commandline -j` now split on `&&` and `||` in addition to `;` and `&` (#6214).
- A bug where `string split` would drop empty strings if the output was only empty strings has been fixed (#5987).
- `eval` no long creates a new local variable scope, but affects variables in the scope it is called from (#4443). `source` still creates a new local scope.
- `abbr` has a new `--query` option to check for the existence of an abbreviation.
- Local values for `fish_complete_path` and `fish_function_path` are now ignored; only their global values are respected.
- Syntax error reports now display a marker in the correct position (#5812).
- Empty universal variables may now be exported (#5992).
- Exported universal variables are no longer imported into the global scope, preventing shadowing. This makes it easier to change such variables for all fish sessions and avoids breakage when the value is a list of multiple elements (#5258).
- A bug where `for` could use invalid variable names has been fixed (#5800).
- A bug where local variables would not be exported to functions has been fixed (#6153).
- The null command (`:`) now always exits successfully, rather than passing through the previous exit status (#6022).
- The output of `functions FUNCTION` matches the declaration of the function, correctly including comments or blank lines (#5285), and correctly includes any `--wraps` flags (#1625).
- `type` supports a new option, `--short`, which suppress function expansion (#6403).
- `type --path` with a function argument will now output the path to the file containing the definition of that function, if it exists.
- `type --force-path` with an argument that cannot be found now correctly outputs nothing, as documented (#6411).
- The `$hostname` variable is no longer truncated to 32 characters (#5758).
- Line numbers in function backtraces are calculated correctly (#6350).
- A new `fish_cancel` event is emitted when the command line is cancelled, which is useful for terminal integration (#5973).
### Interactive improvements
- Major improvements in performance and functionality to the 'sorin' sample prompt (#5411).
- Added completions for:
- nothing yet...
- Lots of improvements to completions.
- fish_clipboard_* now supports wayland by means of [wl-clipboard](https://github.com/bugaevc/wl-clipboard).
- mandoc can now be used to format the output from `--help` if nroff is not installed
- New color options for the pager have been added (#5524).
- The default escape delay (to differentiate between the escape key and an alt-combination) has been reduced to 30ms, down from 300ms for the default mode and 100ms for vi-mode (#3904).
- In the interest of consistency, `builtin -q` and `command -q` can now be used to query if a builtin or command exists (#5631).
- The `path_helper` on macOS now only runs in login shells, matching the bash implementation.
- `math` now accepts `--scale=max` for the maximum scale (#5579).
- The `forward-bigword` binding now interacts correctly with autosuggestions (#5336)
- New Base16 color options are available through the Web-based configuration (#6504).
- fish only parses `/etc/paths` on macOS in login shells, matching the bash implementation (#5637) and avoiding changes to path ordering in child shells (#5456). It now ignores blank lines like the bash implementation (#5809).
- The locale is now reloaded when the `LOCPATH` variable is changed (#5815).
- `read` no longer keeps a history, making it suitable for operations that shouldn't end up there, like password entry (#5904).
- `dirh` outputs its stack in the correct order (#5477), and behaves as documented when universal variables are used for its stack (#5797).
- `funced` and the edit-commandline-in-buffer bindings did not work in fish 3.0 when the `$EDITOR` variable contained spaces; this has been corrected (#5625).
- Builtins now pipe their help output to a pager automatically (#6227).
- `set_color` now colors the `--print-colors` output in the matching colors if it is going to a terminal.
- fish now underlines every valid entered path instead of just the last one (#5872).
- When syntax highlighting a string with an unclosed quote, only the quote itself will be shown as an error, instead of the whole argument.
- Syntax highlighting works correctly with variables as commands (#5658) and redirections to close file descriptors (#6092).
- `help` works properly on Windows Subsytem for Linux (#5759, #6338).
- A bug where `disown` could crash the shell has been fixed (#5720).
- fish will not autosuggest files ending with `~` unless there are no other candidates, as these are generally backup files (#985).
- Escape in the pager works correctly (#5818).
- Key bindings that call `fg` no longer leave the terminal in a broken state (#2114).
- Brackets (#5831) and filenames containing `$` (#6060) are completed with appropriate escaping.
- The output of `complete` and `functions` is now colorized in interactive terminals.
- The Web-based configuration handles aliases that include single quotes correctly (#6120), and launches correctly under Termux (#6248) and OpenBSD (#6522).
- `function` now correctly validates parameters for `--argument-names` as valid variable names (#6147) and correctly parses options following `--argument-names`, as in "`--argument-names foo --description bar`" (#6186).
- History newly imported from bash includes command lines using `&&` or `||`.
- The automatic generation of completions from manual pages is better described in job and process listings, and no longer produces a warning when exiting fish (#6269).
- In private mode, setting `$fish_greeting` to an empty string before starting the private session will prevent the warning about history not being saved from being printed (#6299).
- In the interactive editor, a line break (Enter) inside unclosed brackets will insert a new line, rather than executing the command and producing an error (#6316).
- Ctrl-C always repaints the prompt (#6394).
- When run interactively from another program (such as Python), fish will correctly start a new process group, like other shells (#5909).
- Job identifiers (for example, for background jobs) are assigned more logically (#6053).
- A bug where history would appear truncated if an empty command was executed was fixed (#6032).
#### New or improved bindings
- Pasting strips leading spaces to avoid pasted commands being omitted from the history (#4327).
- Shift-Left and Shift-Right now default to moving backwards and forwards by one bigword (words separated by whitespace) (#1505).
- The default escape delay (to differentiate between the escape key and an alt-combination) has been reduced to 30ms, down from 300ms for the default mode and 100ms for Vi mode (#3904).
- The `forward-bigword` binding now interacts correctly with autosuggestions (#5336).
- The `fish_clipboard_*` functions support Wayland by using [`wl-clipboard`](https://github.com/bugaevc/wl-clipboard) (#5450).
- The `nextd` and `prevd` functions no longer print "Hit end of history", instead using a bell. They correctly store working directories containing symbolic links (#6395).
- If a `fish_mode_prompt` function exists, Vi mode will only execute it on mode-switch instead of the entire prompt. This should make it much more responsive with slow prompts (#5783).
- The path-component bindings (like Ctrl-w) now also stop at ":" and "@", because those are used to denote user and host in commands such as `ssh` (#5841).
- The NULL character can now be bound via `bind -k nul`. Terminals often generate this character via control-space. (#3189).
- A new readline command `expand-abbr` can be used to trigger abbreviation expansion (#5762).
- A new readline command, `delete-or-exit`, removes a character to the right of the cursor or exits the shell if the command line is empty (moving this functionality out of the `delete-or-exit` function).
- The `self-insert` readline command will now insert the binding sequence, if not empty.
- A new binding to prepend `sudo`, bound to Alt-S by default (#6140).
- The Alt-W binding to describe a command should now work better with multiline prompts (#6110)
- The Alt-H binding to open a command's man page now tries to ignore `sudo` (#6122).
- A new pair of bind functions, `history-prefix-search-backward` (and `forward`), was introduced (#6143).
- Vi mode now supports R to enter replace mode (#6342), and `d0` to delete the current line (#6292).
- In Vi mode, hitting Enter in replace-one mode no longer erases the prompt (#6298).
- Selections in Vi mode are inclusive, matching the actual behaviour of Vi (#5770).
#### Improved prompts
- The Git prompt in informative mode now shows the number of stashes if enabled.
- The Git prompt now has an option (`$__fish_git_prompt_use_informative_chars`) to use the (more modern) informative characters without enabling informative mode.
- The default prompt now also features VCS integration and will color the host if running via SSH (#6375).
- The default and example prompts print the pipe status if an earlier command in the pipe fails.
- The default and example prompts try to resolve exit statuses to signal names when appropriate.
#### Improved terminal output
- New `fish_pager_color_` options have been added to control more elements of the pager's colors (#5524).
- Better detection and support for using fish from various system consoles, where limited colors and special characters are supported (#5552).
- fish now tries to guess if the system supports Unicode 9 (and displays emoji as wide), eliminating the need to set `$fish_emoji_width` in most cases (#5722).
- Improvements to the display of wide characters, particularly Korean characters and emoji (#5583, #5729).
- The Vi mode cursor is correctly redrawn when regaining focus under terminals that report focus (eg tmux) (#4788).
- Variables that control background colors (such as `fish_pager_color_search_match`) can now use `--reverse`.
#### Completions
- Added completions for
- `cf`
- `bosh`
- `aws`
- `bat` (#6052)
- `bosh` (#5700)
- `btrfs`
- `camcontrol`
- `cf` (#5700)
- `chronyc` (#6496)
- `code` (#6205)
- `cryptsetup` (#6488)
- `csc` and `csi` (#6016)
- `cwebp` (#6034)
- `cygpath` and `cygstart` (#6239)
- `epkginfo` (#5829)
- `ffmpeg`, `ffplay`, and `ffprobe` (#5922)
- `fsharpc` and `fsharpi` (#6016)
- `fzf` (#6178)
- `g++` (#6217)
- `gpg1` (#6139)
- `gpg2` (#6062)
- `grub-mkrescue` (#6182)
- `hledger` (#6043)
- `hwinfo` (#6496)
- `irb` (#6260)
- `iw` (#6232)
- `kak`
- `keepassxc-cli` (#6505)
- `keybase` (#6410)
- `loginctl` (#6501)
- `lz4`, `lz4c` and `lz4cat` (#6364)
- `mariner` (#5718)
- `nethack` (#6240)
- `patool` (#6083)
- `phpunit` (#6197)
- `plutil` (#6301)
- `pzstd` (#6364)
- `qubes-gpg-client` (#6067)
- `resolvectl` (#6501)
- `rg`
- `rustup`
- `sfdx` (#6149)
- `speedtest` and `speedtest-cli` (#5840)
- `src` (#6026)
- `tokei` (#6085)
- `tsc` (#6016)
- `unlz4` (#6364)
- `unzstd` (#6364)
- `vbc` (#6016)
- `zpaq` (#6245)
- `zstd`, `zstdcat`, `zstdgrep`, `zstdless` and `zstdmt` (#6364)
- Lots of improvements to completions.
- Selecting short options which also have a long name from the completion pager is possible (#5634).
- Tab completion will no longer add trailing spaces if they already exist (#6107).
- Completion of subcommands to builtins like `and` or `not` now works correctly (#6249).
- Completion of arguments to short options works correctly when multiple short options are used together (#332).
- Activating completion in the middle of an invalid completion does not move the cursor any more, making it easier to fix a mistake (#4124).
- Completion in empty commandlines now lists all available commands.
- Functions listed as completions could previously leak parts of the function as other completions; this has been fixed.
### Deprecations and removed features
- The vcs-prompt functions have been promoted to names without double-underscore, so __fish_git_prompt is now fish_git_prompt, __fish_vcs_prompt is now fish_vcs_prompt, __fish_hg_prompt is now fish_hg_prompt and __fish_svn_prompt is now fish_svn_prompt. Shims at the old names have been added, and the variables have kept their old names (#5586).
- `string replace` has an additional round of escaping in the replacement expression, so escaping backslashes requires many escapes (eg `string replace -ra '([ab])' '\\\\\\\$1' a`). The new feature flag `regex-easyesc` can be used to disable this, so that the same effect can be achieved with `string replace -ra '([ab])' '\\\\$1' a` (#5556). As a reminder, the intention behind feature flags is that this will eventually become the default and then only option, so scripts should be updated.
- The `fish_vi_mode` function, deprecated in fish 2.3, has been removed. Use `fish_vi_key_bindings` instead (#6372).
### For distributors and developers
- fish 3.0 introduced a CMake-based build system. In fish 3.1, both the Autotools-based build and legacy Xcode build system have been removed, leaving only the CMake build system. All distributors and developers must install CMake.
- fish now depends on the common `tee` external command, for the `psub` process substitution function.
- The documentation is now built with Sphinx. The old Doxygen-based documentation system has been removed. Developers, and distributors who wish to rebuild the documentation, must install Sphinx.
- The `INTERNAL_WCWIDTH` build option has been removed, as fish now always uses an internal `wcwidth` function. It has a number of configuration options that make it more suitable for general use (#5777).
- mandoc can now be used to format the output from `--help` if `nroff` is not installed, reducing the number of external dependencies on systems with `mandoc` installed (#5489).
- Some bugs preventing building on Solaris-derived systems such as Illumos were fixed (#5458, #5461, #5611).
- Completions for `npm`, `bower` and `yarn` no longer require the `jq` utility for full functionality, but will use Python instead if it is available.
- The paths for completions, functions and configuration snippets have been extended. On systems that define `XDG_DATA_DIRS`, each of the directories in this variable are searched in the subdirectories `fish/vendor_completions.d`, `fish/vendor_functions.d`, and `fish/vendor_conf.d` respectively. On systems that do not define this variable in the environment, the vendor directories are searched for in both the installation prefix and the default "extra" directory, which now defaults to `/usr/local` (#5029).
---

View File

@@ -4,18 +4,24 @@ IF(POLICY CMP0066)
CMAKE_POLICY(SET CMP0066 OLD)
ENDIF()
IF(POLICY CMP0067)
CMAKE_POLICY(SET CMP0067 OLD)
CMAKE_POLICY(SET CMP0067 NEW)
ENDIF()
PROJECT(fish)
# We are C++11.
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
SET(DEFAULT_BUILD_TYPE "RelWithDebInfo")
# Use the default flags (#6296) but remove -DNDEBUG so that asserts remain enabled.
STRING(REPLACE "-DNDEBUG" ""
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
STRING(REPLACE "-DNDEBUG" ""
CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE}")
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
MESSAGE(STATUS "Setting build type to default '${DEFAULT_BUILD_TYPE}'")
SET(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}")
@@ -30,10 +36,32 @@ if (CMAKE_GENERATOR STREQUAL "Ninja" AND
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
endif()
# Enable a whole bunch of warnings, but turn off:
# - implicit fallthrough because that does not recognize some cases where it's desired (and I *really* want this one!)
# - comment because we use a bunch of those, and they're not really all that harmful.
# - address, because that occurs for our mkostemp check (weak-linking requires us to compare `&mkostemp == nullptr`).
# - strict-aliasing, because on old GCCs (*Travis*) those are triggered by maybe.h, so you get it every time it is included.
# - redundant-move, because we have one that is required on old libc
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra \
-Wno-implicit-fallthrough \
-Wno-comment \
-Wno-address \
-Wno-strict-aliasing \
-Wno-redundant-move \
")
# Disable exception handling.
ADD_COMPILE_OPTIONS(-fno-exceptions)
# Prefer the gold linker because it doesn't emit useless warnings about sys_nerr and _sys_errlist.
if (UNIX AND NOT APPLE)
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if ("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
endif()
endif()
# Hide the CMake Rules directories in Xcode projects.
SOURCE_GROUP("CMake Rules" REGULAR_EXPRESSION "^$")
@@ -77,18 +105,20 @@ SET(FISH_SRCS
src/builtin_random.cpp src/builtin_read.cpp src/builtin_realpath.cpp
src/builtin_return.cpp src/builtin_set.cpp src/builtin_set_color.cpp
src/builtin_source.cpp src/builtin_status.cpp src/builtin_string.cpp
src/builtin_test.cpp src/builtin_ulimit.cpp src/builtin_wait.cpp
src/color.cpp src/common.cpp src/complete.cpp src/env.cpp
src/builtin_test.cpp src/builtin_ulimit.cpp src/builtin_wait.cpp src/builtin_eval.cpp
src/color.cpp src/common.cpp src/complete.cpp src/env.cpp src/env_dispatch.cpp
src/env_universal_common.cpp src/event.cpp src/exec.cpp src/expand.cpp
src/fallback.cpp src/fish_version.cpp src/function.cpp src/highlight.cpp
src/history.cpp src/input.cpp src/input_common.cpp src/intern.cpp src/io.cpp
src/iothread.cpp src/kill.cpp src/output.cpp src/pager.cpp
src/history.cpp src/history_file.cpp src/input.cpp src/input_common.cpp src/intern.cpp
src/io.cpp src/iothread.cpp src/kill.cpp src/output.cpp src/pager.cpp
src/parse_execution.cpp src/parse_productions.cpp src/parse_tree.cpp
src/parse_util.cpp src/parser.cpp src/parser_keywords.cpp src/path.cpp
src/postfork.cpp src/proc.cpp src/reader.cpp src/sanity.cpp src/screen.cpp
src/signal.cpp src/tinyexpr.cpp src/tnode.cpp src/tokenizer.cpp src/utf8.cpp src/util.cpp
src/wcstringutil.cpp src/wgetopt.cpp src/wildcard.cpp src/wutil.cpp
src/future_feature_flags.cpp src/redirection.cpp src/topic_monitor.cpp
src/flog.cpp src/trace.cpp src/timer.cpp src/null_terminated_array.cpp
src/operation_context.cpp
)
# Header files are just globbed.
@@ -127,22 +157,12 @@ SET_SOURCE_FILES_PROPERTIES(src/fish_version.cpp
PROPERTIES OBJECT_DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${FBVF})
OPTION(INTERNAL_WCWIDTH "use fallback wcwidth" ON)
IF(INTERNAL_WCWIDTH)
ADD_DEFINITIONS(-DHAVE_BROKEN_WCWIDTH=1)
ELSE()
ADD_DEFINITIONS(-DHAVE_BROKEN_WCWIDTH=0)
ENDIF()
# Enable thread-safe errno on Solaris (#5611)
ADD_DEFINITIONS(-D_REENTRANT)
# Set up PCRE2
INCLUDE(cmake/PCRE2.cmake)
# Set up the docs.
INCLUDE(cmake/Docs.cmake)
# Define a function to link dependencies.
FUNCTION(FISH_LINK_DEPS target)
TARGET_LINK_LIBRARIES(${target} fishlib)
@@ -153,7 +173,7 @@ ADD_LIBRARY(fishlib STATIC ${FISH_SRCS})
TARGET_SOURCES(fishlib PRIVATE ${FISH_HEADERS})
TARGET_LINK_LIBRARIES(fishlib
${CURSES_LIBRARY} ${CURSES_EXTRA_LIBRARY} Threads::Threads ${CMAKE_DL_LIBS}
${PCRE2_LIB} ${Intl_LIBRARIES})
${PCRE2_LIB} ${Intl_LIBRARIES} ${ATOMIC_LIBRARY})
# Define fish.
ADD_EXECUTABLE(fish src/fish.cpp)
@@ -169,9 +189,18 @@ ADD_EXECUTABLE(fish_key_reader
src/fish_key_reader.cpp src/print_help.cpp)
FISH_LINK_DEPS(fish_key_reader)
# Set up the docs.
INCLUDE(cmake/Docs.cmake)
# A helper for running tests.
ADD_EXECUTABLE(fish_test_helper src/fish_test_helper.cpp)
# Set up tests.
INCLUDE(cmake/Tests.cmake)
# Benchmarking support.
INCLUDE(cmake/Benchmark.cmake)
# Set up install.
INCLUDE(cmake/Install.cmake)

View File

@@ -297,7 +297,13 @@ sudo ln -s /usr/bin/clang-format-3.9 /usr/bin/clang-format
## Message Translations
Fish uses the GNU gettext library to translate messages from English to other languages. To create or update a translation run `make po/[LANGUAGE CODE].po` where `LANGUAGE CODE` is the two letter ISO 639-1 language code of the language you are translating to (e.g. `de` for German). Make sure that you have the `xgettext`, `msgfmt` and `msgmerge` commands installed in order to do this.
Fish uses the GNU gettext library to translate messages from English to other languages.
All non-debug messages output for user consumption should be marked for translation. In C++, this requires the use of the `_` (underscore) macro:
```
streams.out.append_format(_(L"%ls: There are no jobs\n"), argv[0]);
```
All messages in fish script must be enclosed in single or double quote characters. They must also be translated via a subcommand. This means that the following are **not** valid:
@@ -315,6 +321,18 @@ echo (_ "goodbye")
Note that you can use either single or double quotes to enclose the message to be translated. You can also optionally include spaces after the opening parentheses and once again before the closing parentheses.
Be cautious about blindly updating an existing translation file. Trivial changes to an existing message (e.g., changing the punctuation) will cause existing translations to be removed, since the tools do literal string matching. Therefore, in general, you need to carefully review any recommended deletions.
Creating and updating translations requires the Gettext tools, including `xgettext`, `msgfmt` and `msgmerge`. Translation sources are stored in the `po` directory, named `LANG.po`, where `LANG` is the two letter ISO 639-1 language code of the target language (eg `de` for German).
To create a new translation, for example for German:
* generate a `messages.pot` file by running `build_tools/fish_xgettext.fish` from the source tree
* copy `messages.pot` to `po/LANG.po` ()
To update a translation:
* generate a `messages.pot` file by running `build_tools/fish_xgettext.fish` from the source tree
* update the existing translation by running `msgmerge --update --no-fuzzy-matching po/LANG.po messages.pot`
Many tools are available for editing translation files, including command-line and graphical user interface programs.
Be cautious about blindly updating an existing translation file. Trivial changes to an existing message (eg changing the punctuation) will cause existing translations to be removed, since the tools do literal string matching. Therefore, in general, you need to carefully review any recommended deletions.
Read the [translations wiki](https://github.com/fish-shell/fish-shell/wiki/Translations) for more information.

View File

@@ -1,6 +1,7 @@
Fish is a smart and user-friendly command line shell.
Copyright (C) 2005-2009 Axel Liljencrantz
Copyright (C) 2009-2019 fish-shell contributors
fish is free software.

View File

@@ -2,7 +2,8 @@ FROM centos:latest
# Build dependency
RUN yum update -y &&\
yum install -y clang cmake gcc-c++ make ncurses-devel &&\
yum install -y epel-release &&\
yum install -y clang cmake3 gcc-c++ make ncurses-devel &&\
yum clean all
# Test dependency
@@ -12,7 +13,7 @@ ADD . /src
WORKDIR /src
# Build fish
RUN cmake . &&\
RUN cmake3 . &&\
make &&\
make install

69
GNUmakefile Normal file
View File

@@ -0,0 +1,69 @@
# This is a very basic `make` wrapper around the CMake build toolchain.
#
# Supported arguments:
# PREFIX: sets the installation prefix
# GENERATOR: explicitly specifies the CMake generator to use
CMAKE ?= cmake
GENERATOR ?= $(shell (which ninja > /dev/null 2> /dev/null && echo Ninja) || \
echo 'Unix Makefiles')
prefix ?= /usr/local
PREFIX ?= $(prefix)
ifeq ($(GENERATOR), Ninja)
BUILDFILE = build.ninja
else
BUILDFILE = Makefile
endif
# If CMake has generated an in-tree Makefile, use that instead (issue #6264)
MAKE_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ifeq ($(shell test -f $(MAKE_DIR)/Makefile && echo 1), 1)
all:
@+$(MAKE) -f $(MAKE_DIR)/Makefile $(MAKECMDGOALS) --no-print-directory
%:
@+$(MAKE) -f $(MAKE_DIR)/Makefile $(MAKECMDGOALS) --no-print-directory
else
all: .begin build/fish
PHONY: .begin
.begin:
@which $(CMAKE) > /dev/null 2> /dev/null || \
(echo 'Please install CMake and then re-run the `make` command!' 1>&2 && false)
build/fish: build/$(BUILDFILE)
$(CMAKE) --build build
build/$(BUILDFILE): build
cd build; $(CMAKE) .. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G "$(GENERATOR)" \
-DCMAKE_INSTALL_PREFIX="$(PREFIX)" -DCMAKE_EXPORT_COMPILE_COMMANDS=1
build:
mkdir -p build
.PHONY: clean
clean:
rm -rf build
.PHONY: test
test: build/fish
$(CMAKE) --build build --target test
.PHONY: install
install: build/fish
$(CMAKE) --build build --target install
.PHONY: run
run: build/fish
./build/fish || true
.PHONY: exec
exec: build/fish
exec ./build/fish
endif # CMake in-tree build check

File diff suppressed because it is too large Load Diff

View File

@@ -66,7 +66,7 @@ Once installed, run `fish` from your current shell to try fish out!
Running fish requires:
* curses or ncurses (preinstalled on most \*nix systems)
* some common \*nix system utilities (currently `mktemp` and `seq`), in addition to the basic POSIX utilities
* some common \*nix system utilities (currently `mktemp`), in addition to the basic POSIX utilities (`cat`, `cut`, `dirname`, `ls`, `mkdir`, `mkfifo`, `rm`, `sort`, `tee`, `tr`, `uname` and `sed` at least, but the full coreutils plus find, sed and awk is preferred)
* gettext (library and `gettext` command), if compiled with translation support
The following optional features also have specific requirements:
@@ -76,8 +76,7 @@ The following optional features also have specific requirements:
`backports.lzma` module for Python 2.7
* the `fish_config` web configuration tool requires Python (2.7+ or 3.3 +) and a web browser
* system clipboard integration (with the default Ctrl-V and Ctrl-X bindings) require either the
`xsel` or `pbcopy`/`pbpaste` utilities
* full completions for `yarn` and `bower` require the `jq` utility
`xsel`, `xclip`, `wl-copy`/`wl-paste` or `pbcopy`/`pbpaste` utilities
* full completions for `yarn` and `npm` require the `all-the-package-names` NPM module
### Switching to fish
@@ -86,7 +85,7 @@ If you wish to use fish as your default shell, use the following command:
chsh -s /usr/local/bin/fish
`chsh` will prompt you for your password and change your default shell. (Substitute `/usr/local/bin/fish` with whatever path fish was installed to, if it differs.)
`chsh` will prompt you for your password and change your default shell. (Substitute `/usr/local/bin/fish` with whatever path fish was installed to, if it differs.) Log out, then log in again for the changes to take effect.
Use the following command if fish isn't already added to `/etc/shells` to permit fish to be your login shell:
@@ -101,16 +100,16 @@ To switch your default shell back, you can run `chsh -s /bin/bash` (substituting
Compiling fish requires:
* a C++11 compiler (g++ 4.8 or later, or clang 3.3 or later)
* any of CMake, GNU Make, or (on macOS only) Xcode
* CMake (version 3.2 or later)
* a curses implementation such as ncurses (headers and libraries)
* PCRE2 (headers and libraries) - a copy is included with fish
* gettext (headers and libraries) - optional, for translation support
Additionally, if compiling fish with GNU Make from git (that is, not from an officially released tarball), `autoconf` 2.60+ and `automake` 1.13+ are required. Doxygen (1.8.7 or later) is also optionally required to build the documentation from a cloned git repository.
Sphinx is also optionally required to build the documentation from a cloned git repository.
### Building from source (all platforms)
### Building from source (all platforms) - Makefile generator
#### Using CMake (preferred)
To install into `/usr/local`, run:
```bash
mkdir build; cd build
@@ -119,22 +118,32 @@ make
sudo make install
```
#### Using autotools
The install directory can be changed using the `-DCMAKE_INSTALL_PREFIX` parameter for `cmake`.
### Building from source (macOS) - Xcode
```bash
autoreconf --no-recursive #if building from Git
./configure
make
sudo make install
mkdir build; cd build
cmake .. -G Xcode
```
An Xcode project will now be available in the `build` subdirectory. You can open it with Xcode,
or run the following to build and install in `/usr/local`:
```bash
xcodebuild
xcodebuild -scheme install
```
The install directory can be changed using the `-DCMAKE_INSTALL_PREFIX` parameter for `cmake`.
### Help, it didn't build!
If fish reports that it could not find curses, try installing a curses development package and build again.
On Debian or Ubuntu you want:
sudo apt-get install build-essential ncurses-dev libncurses5-dev gettext autoconf
sudo apt-get install build-essential cmake ncurses-dev libncurses5-dev libpcre2-dev gettext
On RedHat, CentOS, or Amazon EC2:
@@ -146,6 +155,6 @@ See the [Guide for Developers](CONTRIBUTING.md).
## Contact Us
Questions, comments, rants and raves can be posted to the official fish mailing list at <https://lists.sourceforge.net/lists/listinfo/fish-users> or join us on our [gitter.im channel](https://gitter.im/fish-shell/fish-shell) or IRC channel [#fish at irc.oftc.net](https://webchat.oftc.net/?channels=fish). Or use the [fish tag on Stackoverflow](https://stackoverflow.com/questions/tagged/fish) for questions related to fish script and the [fish tag on Superuser](https://superuser.com/questions/tagged/fish) for all other questions (e.g., customizing colors, changing key bindings).
Questions, comments, rants and raves can be posted to the official fish mailing list at <https://lists.sourceforge.net/lists/listinfo/fish-users> or join us on our [gitter.im channel](https://gitter.im/fish-shell/fish-shell). Or use the [fish tag on Stackoverflow](https://stackoverflow.com/questions/tagged/fish) for questions related to fish script and the [fish tag on Superuser](https://superuser.com/questions/tagged/fish) for all other questions (e.g., customizing colors, changing key bindings).
Found a bug? Have an awesome idea? Please [open an issue](https://github.com/fish-shell/fish-shell/issues/new).

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
for i in (seq 2000)
command true
end

View File

@@ -0,0 +1,3 @@
for i in (seq 1000)
echo $i
end

17
benchmarks/driver.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: driver.sh /path/to/fish"
fi
FISH_PATH=$1
BENCHMARKS_DIR=$(dirname "$0")/benchmarks
for benchmark in "$BENCHMARKS_DIR"/*; do
basename "$benchmark"
${FISH_PATH} --print-rusage-self "$benchmark" > /dev/null
if command -v hyperfine >/dev/null 2>&1; then
hyperfine "${FISH_PATH} $benchmark > /dev/null"
fi
done

View File

@@ -10,37 +10,37 @@ set profile2 (cat $argv[2])
set line_no 0
while set next_line_no (math $line_no + 1) && set -q profile1[$next_line_no] && set -q profile2[$next_line_no]
set line_no $next_line_no
set line_no $next_line_no
set line1 $profile1[$line_no]
set line2 $profile2[$line_no]
set line1 $profile1[$line_no]
set line2 $profile2[$line_no]
if not string match -qr '^\d+\t\d+' $line1
echo $line1
continue
end
if not string match -qr '^\d+\t\d+' $line1
echo $line1
continue
end
set results1 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line1)
set results2 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line2)
set results1 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line1)
set results2 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line2)
# times from both files
set time1 $results1[2..3]
set time2 $results2[2..3]
# times from both files
set time1 $results1[2..3]
set time2 $results2[2..3]
# leftover from both files
set remainder1 $results1[4]
set remainder2 $results2[4]
# leftover from both files
set remainder1 $results1[4]
set remainder2 $results2[4]
if not string match -q -- $remainder1 $remainder2
echo Mismatch on line $line_no:
echo - $remainder1
echo + $remainder2
exit 1
end
if not string match -q -- $remainder1 $remainder2
echo Mismatch on line $line_no:
echo - $remainder1
echo + $remainder2
exit 1
end
set -l diff
set diff[1] (math $time1[1] - $time2[1])
set diff[2] (math $time1[2] - $time2[2])
set -l diff
set diff[1] (math $time1[1] - $time2[1])
set diff[2] (math $time1[2] - $time2[2])
echo $diff[1] $diff[2] $remainder1
echo $diff[1] $diff[2] $remainder1
end

View File

@@ -4,6 +4,22 @@
# for object files in this directory.
# This was written for macOS nm.
set FISH_SOURCE_DIR $argv[1]
if not test -d "$FISH_SOURCE_DIR"
echo "FISH_SOURCE_DIR not given"
exit 1
end
set -g whitelist \
# unclear what this is \
l_constinit \
# hacks to work around missing ncurses strings on mac \
sitm_esc ritm_esc dim_esc \
# In our nm regex, we are interested in data (dD) and bss (bB) segments.
set -g nm_regex '^([^ ]+) ([dDbB])'
set total_globals 0
set boring_files \
fish_key_reader.cpp.o \
@@ -11,31 +27,86 @@ set boring_files \
fish_indent.cpp.o \
set whitelist \
termsize_lock termsize \
initial_pid initial_fg_process_group \
_debug_level \
sitm_esc ritm_esc dim_esc \
iothread_init()::inited \
s_result_queue s_main_thread_request_queue s_read_pipe s_write_pipe \
s_main_thread_performer_lock s_main_thread_performer_cond s_main_thread_request_q_lock \
locked_consumed_job_ids \
env_initialized \
# return if we should ignore the given symbol name
function should_ignore
set symname $argv[1]
string match -q '*guard variable for*' $symname
and return 0
contains $symname $whitelist
and return 0
return 1
end
# echo a cleaned-up symbol name, e.g. replacing template gunk
function cleanup_syname
set symname $argv[1]
set symname (string replace --all 'std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >' 'wcstring' $symname)
set symname (string replace --all 'std::__1::vector<wcstring, std::__1::allocator<wcstring > >' 'wcstring_list_t' $symname)
echo $symname
end
# Output the declaration for a symbol name in a given file.
function print_decl
set -l objfile $argv[1]
set -l symname $argv[2]
set -l varname (string split '::' $symname)[-1]
set -l srcfile (basename $objfile .o)
set -l srcpath $FISH_SOURCE_DIR/src/$srcfile
# A leading underscore indicates a global, strip it.
set varname (string replace --regex '^_' '' $varname)
if not test -f "$srcpath"
echo "Could not find $srcpath"
end
# Guess the variable as the first usage of the name.
# Strip everything after the first =.
set vardecl (egrep -m 1 " $varname\\b" $srcpath | cut -f -1 -d '=' | string trim)
if test -z "$vardecl"
echo "COULD_NOT_FIND_$varname"
return 1
end
echo $vardecl
return 0
end
# Return if a variable declaration is "thread safe".
function decl_is_threadsafe
set -l vardecl $argv[1]
# decls starting with 'const ' or containing ' const ' are assumed safe.
string match -q --regex '(^|\\*| )const ' $vardecl
and return 0
# Ordinary types indicating a safe variable.
set safes relaxed_atomic_bool_t std::mutex std::condition_variable std::once_flag sig_atomic_t
for safe in $safes
string match -q "*$safe*" $vardecl
and return 0
end
# Template types indicate a safe variable.
set safes owning_lock mainthread_t std::atomic relaxed_atomic_t latch_t
for safe in $safes
string match -q "*$safe<*" $vardecl
and return 0
end
end
for file in ./**.o
set filename (basename $file)
# Skip boring files.
contains $filename $boring_files
and continue
for line in (nm -p -P -U $file)
# Look in data (dD) and bss (bB) segments.
set matches (string match --regex '^([^ ]+) ([dDbB])' -- $line)
for line in (nm -p -P -U $file | egrep $nm_regex)
set matches (string match --regex $nm_regex -- $line)
or continue
set symname (echo $matches[2] | c++filt)
contains $symname $whitelist
set symname (cleanup_syname (echo $matches[2] | c++filt))
should_ignore $symname
and continue
echo $filename $symname $matches[3]
set vardecl (print_decl $filename $symname)
decl_is_threadsafe $vardecl
and continue
echo $filename $symname $matches[3] ":" $vardecl
set total_globals (math $total_globals + 1)
end
end

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env fish
#
# Tool to generate messages.pot
# Extended to replace the old Makefile rule which did not port easily to CMak
# This script was originally motivated to work around a quirk (or bug depending on your viewpoint)
# of the xgettext command. See https://lists.gnu.org/archive/html/bug-gettext/2014-11/msg00006.html.
# However, it turns out that even if that quirk did not exist we would still need something like
@@ -8,14 +11,19 @@
# all the strings we want translated. So we extract and normalize all such strings into a format
# that `xgettext` can handle.
# Start with the C++ source
xgettext -k -k_ -kN_ -LC++ --no-wrap -o messages.pot src/*.cpp src/*.h
# This regex handles descriptions for `complete` and `function` statements. These messages are not
# particularly important to translate. Hence the "implicit" label.
set implicit_regex '(?:^| +)(?:complete|function) .*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
set implicit_regex '(?:^| +)(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
# This regex handles explicit requests to translate a message. These are more important to translate
# than messages which should be implicitly translated.
set explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
rm -r /tmp/fish
mkdir -p /tmp/fish/implicit/share/completions /tmp/fish/implicit/share/functions
mkdir -p /tmp/fish/explicit/share/completions /tmp/fish/explicit/share/functions
@@ -29,7 +37,7 @@ for f in share/config.fish share/completions/*.fish share/functions/*.fish
rm /tmp/fish/explicit/$f.tmp
# Handle `complete` / `function` description messages. The `| fish` is subtle. It basically
# avoids the need to use `source` with a command substituion that could affect the current
# avoids the need to use `source` with a command substitution that could affect the current
# shell.
string replace --filter --regex $implicit_regex 'echo $1' <$f | fish >/tmp/fish/implicit/$f.tmp ^/dev/null
while read description
@@ -40,3 +48,8 @@ for f in share/config.fish share/completions/*.fish share/functions/*.fish
end </tmp/fish/implicit/$f.tmp >/tmp/fish/implicit/$f
rm /tmp/fish/implicit/$f.tmp
end
xgettext -j -k -kN_ -LShell --from-code=UTF-8 -cDescription --no-wrap -o messages.pot /tmp/fish/explicit/share/*/*.fish
xgettext -j -k -kN_ -LShell --from-code=UTF-8 -cDescription --no-wrap -o messages.pot /tmp/fish/implicit/share/*/*.fish
rm -r /tmp/fish

View File

@@ -6,8 +6,8 @@
set -e
# Find the fish git directory as two levels up from script directory.
GIT_DIR="$( cd "$( dirname $( dirname "$0" ) )" && pwd )"
# Find the fish directory as two levels up from script directory.
FISH_BASE_DIR="$( cd "$( dirname "$( dirname "$0" )" )" && pwd )"
DEF_VER=unknown
# First see if there is a version file (included in release tarballs),
@@ -15,7 +15,7 @@ DEF_VER=unknown
if test -f version
then
VN=$(cat version) || VN="$DEF_VER"
elif ! VN=$(git -C "$GIT_DIR" describe --always --dirty 2>/dev/null); then
elif ! VN=$(git -C "$FISH_BASE_DIR" describe --always --dirty 2>/dev/null); then
VN="$DEF_VER"
fi
@@ -34,7 +34,7 @@ if test -r $FBVF
then
VC=$(grep -v '^#' $FBVF | tr -d '"' | sed -e 's/^FISH_BUILD_VERSION=//')
else
VC=unset
VC="unset"
fi
# Maybe output the FBVF

View File

@@ -20,8 +20,8 @@ set committers_from_tag (mktemp)
# Unicode collation tables mean that this is fraught with danger; for example, the
# "“" character will not case-fold in UTF-8 locales. sort suggests using the C locale!
git log "$TAG" --format="%aN" --reverse | sort -u > $committers_to_tag
git log "$TAG".. --format="%aN" --reverse | sort -u > $committers_from_tag
git log "$TAG" --format="%aN" --reverse | sort -u >$committers_to_tag
git log "$TAG".. --format="%aN" --reverse | sort -u >$committers_from_tag
echo New committers:
echo (comm -13 $committers_to_tag $committers_from_tag)','

431
build_tools/littlecheck.py Executable file
View File

@@ -0,0 +1,431 @@
#!/usr/bin/env python
""" Command line test driver. """
from __future__ import unicode_literals
import argparse
import io
import re
import shlex
import subprocess
import sys
# A regex showing how to run the file.
RUN_RE = re.compile(r"\s*#\s*RUN:\s+(.*)\n")
# A regex capturing lines that should be checked against stdout.
CHECK_STDOUT_RE = re.compile(r"\s*#\s*CHECK:\s+(.*)\n")
# A regex capturing lines that should be checked against stderr.
CHECK_STDERR_RE = re.compile(r"\s*#\s*CHECKERR:\s+(.*)\n")
class Config(object):
def __init__(self):
# Whether to have verbose output.
self.verbose = False
# Whether output gets ANSI colorization.
self.colorize = False
def colors(self):
""" Return a dictionary mapping color names to ANSI escapes """
def ansic(n):
return "\033[%dm" % n if self.colorize else ""
return {
"RESET": ansic(0),
"BOLD": ansic(1),
"NORMAL": ansic(39),
"BLACK": ansic(30),
"RED": ansic(31),
"GREEN": ansic(32),
"YELLOW": ansic(33),
"BLUE": ansic(34),
"MAGENTA": ansic(35),
"CYAN": ansic(36),
"LIGHTGRAY": ansic(37),
"DARKGRAY": ansic(90),
"LIGHTRED": ansic(91),
"LIGHTGREEN": ansic(92),
"LIGHTYELLOW": ansic(93),
"LIGHTBLUE": ansic(94),
"LIGHTMAGENTA": ansic(95),
"LIGHTCYAN": ansic(96),
"WHITE": ansic(97),
}
def output(*args):
print("".join(args) + "\n")
class CheckerError(Exception):
"""Exception subclass for check line parsing.
Attributes:
line: the Line object on which the exception occurred.
"""
def __init__(self, message, line=None):
super(CheckerError, self).__init__(message)
self.line = line
class Line(object):
""" A line that remembers where it came from. """
def __init__(self, text, number, file):
self.text = text
self.number = number
self.file = file
def subline(self, text):
""" Return a substring of our line with the given text, preserving number and file. """
return Line(text, self.number, self.file)
@staticmethod
def readfile(file, name):
return [Line(text, idx + 1, name) for idx, text in enumerate(file)]
def is_empty_space(self):
return not self.text or self.text.isspace()
class RunCmd(object):
""" A command to run on a given Checker.
Attributes:
args: Unexpanded shell command as a string.
"""
def __init__(self, args, line):
self.args = args
self.line = line
@staticmethod
def parse(line):
if not shlex.split(line.text):
raise CheckerError("Invalid RUN command", line)
return RunCmd(line.text, line)
class TestFailure(object):
def __init__(self, line, check, testrun):
self.line = line
self.check = check
self.testrun = testrun
self.error_annotation_line = None
def message(self):
fields = self.testrun.config.colors()
fields["name"] = self.testrun.name
fields["subbed_command"] = self.testrun.subbed_command
if self.line:
fields.update(
{
"output_file": self.line.file,
"output_lineno": self.line.number,
"output_line": self.line.text.rstrip("\n"),
}
)
if self.check:
fields.update(
{
"input_file": self.check.line.file,
"input_lineno": self.check.line.number,
"input_line": self.check.line.text,
"check_type": self.check.type,
}
)
fmtstrs = ["{RED}Failure{RESET} in {name}:", ""]
if self.line and self.check:
fmtstrs += [
" The {check_type} on line {input_lineno} wants:",
" {BOLD}{input_line}{RESET}",
"",
" which failed to match line {output_file}:{output_lineno}:",
" {BOLD}{output_line}{RESET}",
"",
]
elif self.check:
fmtstrs += [
" The {check_type} on line {input_lineno} wants:",
" {BOLD}{input_line}{RESET}",
"",
" but there was no remaining output to match.",
"",
]
else:
fmtstrs += [
" There were no remaining checks left to match {output_file}:{output_lineno}:",
" {BOLD}{output_line}{RESET}",
"",
]
if self.error_annotation_line:
fields["error_annotation"] = self.error_annotation_line.text
fields["error_annotation_lineno"] = self.error_annotation_line.number
fmtstrs += [
" additional output on stderr:{error_annotation_lineno}:",
" {BOLD}{error_annotation}{RESET}",
]
fmtstrs += [" when running command:", " {subbed_command}"]
return "\n".join(fmtstrs).format(**fields)
def print_message(self):
""" Print our message to stdout. """
print(self.message())
def perform_substitution(input_str, subs):
""" Perform the substitutions described by subs to str
Return the substituted string.
"""
# Sort our substitutions into a list of tuples (key, value), descending by length.
# It needs to be descending because we need to try longer substitutions first.
subs_ordered = sorted(subs.items(), key=lambda s: len(s[0]), reverse=True)
def subber(m):
# We get the entire sequence of characters.
# Replace just the prefix and return it.
text = m.group(1)
for key, replacement in subs_ordered:
if text.startswith(key):
return replacement + text[len(key) :]
raise CheckerError("Unknown substitution: " + m.group(0))
return re.sub(r"%(%|[a-zA-Z0-9_-]+)", subber, input_str)
class TestRun(object):
def __init__(self, name, runcmd, checker, subs, config):
self.name = name
self.runcmd = runcmd
self.subbed_command = perform_substitution(runcmd.args, subs)
self.checker = checker
self.subs = subs
self.config = config
def check(self, lines, checks):
# Reverse our lines and checks so we can pop off the end.
lineq = lines[::-1]
checkq = checks[::-1]
while lineq and checkq:
line = lineq[-1]
check = checkq[-1]
if check.regex.match(line.text):
# This line matched this checker, continue on.
lineq.pop()
checkq.pop()
elif line.is_empty_space():
# Skip all whitespace input lines.
lineq.pop()
else:
# Failed to match.
return TestFailure(line, check, self)
# Drain empties.
while lineq and lineq[-1].is_empty_space():
lineq.pop()
# If there's still lines or checkers, we have a failure.
# Otherwise it's success.
if lineq:
return TestFailure(lineq[-1], None, self)
elif checkq:
return TestFailure(None, checkq[-1], self)
else:
return None
def run(self):
""" Run the command. Return a TestFailure, or None. """
def split_by_newlines(s):
""" Decode a string and split it by newlines only,
retaining the newlines.
"""
return [s + "\n" for s in s.decode("utf-8").split("\n")]
PIPE = subprocess.PIPE
if self.config.verbose:
print(self.subbed_command)
proc = subprocess.Popen(
self.subbed_command,
stdin=PIPE,
stdout=PIPE,
stderr=PIPE,
shell=True,
close_fds=True, # For Python 2.6 as shipped on RHEL 6
)
stdout, stderr = proc.communicate()
outlines = [
Line(text, idx + 1, "stdout")
for idx, text in enumerate(split_by_newlines(stdout))
]
errlines = [
Line(text, idx + 1, "stderr")
for idx, text in enumerate(split_by_newlines(stderr))
]
outfail = self.check(outlines, self.checker.outchecks)
errfail = self.check(errlines, self.checker.errchecks)
# It's possible that something going wrong on stdout resulted in new
# text being printed on stderr. If we have an outfailure, and either
# non-matching or unmatched stderr text, then annotate the outfail
# with it.
if outfail and errfail and errfail.line:
outfail.error_annotation_line = errfail.line
return outfail if outfail else errfail
class CheckCmd(object):
def __init__(self, line, checktype, regex):
self.line = line
self.type = checktype
self.regex = regex
@staticmethod
def parse(line, checktype):
# type: (Line) -> CheckCmd
# Everything inside {{}} is a regular expression.
# Everything outside of it is a literal string.
# Split around {{...}}. Then every odd index will be a regex, and
# evens will be literals.
# Note that if {{...}} appears first we will get an empty string in
# the split array, so the {{...}} matches are always at odd indexes.
bracket_re = re.compile(
r"""
\{\{ # Two open brackets
(.*?) # Nongreedy capture
\}\} # Two close brackets
""",
re.VERBOSE,
)
pieces = bracket_re.split(line.text)
even = True
re_strings = []
for piece in pieces:
if even:
# piece is a literal string.
re_strings.append(re.escape(piece))
else:
# piece is a regex (found inside {{...}}).
# Verify the regex can be compiled.
try:
re.compile(piece)
except re.error:
raise CheckerError("Invalid regular expression: '%s'" % piece, line)
re_strings.append(piece)
even = not even
# Enclose each piece in a non-capturing group.
# This ensures that lower-precedence operators don't trip up catenation.
# For example: {{b|c}}d would result in /b|cd/ which is different.
# Backreferences are assumed to match across the entire string.
re_strings = ["(?:%s)" % s for s in re_strings]
# Anchor at beginning and end (allowing arbitrary whitespace), and maybe
# a terminating newline.
# We need the anchors because Python's match() matches an arbitrary prefix,
# not the entire string.
re_strings = [r"^\s*"] + re_strings + [r"\s*\n?$"]
full_re = re.compile("".join(re_strings))
return CheckCmd(line, checktype, full_re)
class Checker(object):
def __init__(self, name, lines):
self.name = name
# Helper to yield subline containing group1 from all matching lines.
def group1s(regex):
for line in lines:
m = regex.match(line.text)
if m:
yield line.subline(m.group(1))
# Find run commands.
self.runcmds = [RunCmd.parse(sl) for sl in group1s(RUN_RE)]
if not self.runcmds:
raise CheckerError("No runlines ('# RUN') found")
# Find check cmds.
self.outchecks = [
CheckCmd.parse(sl, "CHECK") for sl in group1s(CHECK_STDOUT_RE)
]
self.errchecks = [
CheckCmd.parse(sl, "CHECKERR") for sl in group1s(CHECK_STDERR_RE)
]
def check_file(input_file, name, subs, config, failure_handler):
""" Check a single file. Return a True on success, False on error. """
success = True
lines = Line.readfile(input_file, name)
checker = Checker(name, lines)
for runcmd in checker.runcmds:
failure = TestRun(name, runcmd, checker, subs, config).run()
if failure:
failure_handler(failure)
success = False
return success
def check_path(path, subs, config, failure_handler):
with io.open(path, encoding="utf-8") as fd:
return check_file(fd, path, subs, config, failure_handler)
def parse_subs(subs):
""" Given a list of input substitutions like 'foo=bar',
return a dictionary like {foo:bar}, or exit if invalid.
"""
result = {}
for sub in subs:
try:
key, val = sub.split("=", 1)
if not key:
print("Invalid substitution %s: empty key" % sub)
sys.exit(1)
if not val:
print("Invalid substitution %s: empty value" % sub)
sys.exit(1)
result[key] = val
except ValueError:
print("Invalid substitution %s: equal sign not found" % sub)
sys.exit(1)
return result
def get_argparse():
""" Return a littlecheck argument parser. """
parser = argparse.ArgumentParser(
description="littlecheck: command line tool tester."
)
parser.add_argument(
"-s",
"--substitute",
type=str,
help="Add a new substitution for RUN lines. Example: bash=/bin/bash",
action="append",
default=[],
)
parser.add_argument("file", nargs="+", help="File to check")
return parser
def main():
args = get_argparse().parse_args()
# Default substitution is %% -> %
def_subs = {"%": "%"}
def_subs.update(parse_subs(args.substitute))
success = True
config = Config()
config.colorize = sys.stdout.isatty()
for path in args.file:
subs = def_subs.copy()
subs["s"] = path
if not check_path(path, subs, config, TestFailure.print_message):
success = False
sys.exit(0 if success else 1)
if __name__ == "__main__":
main()

View File

@@ -2,9 +2,12 @@
# Script to produce an OS X installer .pkg and .app(.zip)
VERSION=`git describe --always --dirty 2>/dev/null`
VERSION=$(git describe --always --dirty 2>/dev/null)
if test -z "$VERSION" ; then
echo "Could not get version from git"
if test -f version; then
VERSION=$(cat version)
fi
fi
echo "Version is $VERSION"
@@ -14,19 +17,19 @@ set -x
#Exit on error
set -e
PKGDIR=`mktemp -d`
PKGDIR=$(mktemp -d)
SRC_DIR=$PWD
OUTPUT_PATH=${FISH_ARTEFACT_PATH:-~/fish_built}
mkdir -p $PKGDIR/build $PKGDIR/root $PKGDIR/intermediates $PKGDIR/dst
( cd "$PKGDIR/build" && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo "$SRC_DIR" && make -j 4 && env DESTDIR=$PKGDIR/root/ make install )
pkgbuild --scripts build_tools/osx_package_scripts --root $PKGDIR/root/ --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" $PKGDIR/intermediates/fish.pkg
mkdir -p "$PKGDIR/build" "$PKGDIR/root" "$PKGDIR/intermediates" "$PKGDIR/dst"
{ cd "$PKGDIR/build" && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo "$SRC_DIR" && make -j 4 && env DESTDIR="$PKGDIR/root/" make install; }
pkgbuild --scripts build_tools/osx_package_scripts --root "$PKGDIR/root/" --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" "$PKGDIR/intermediates/fish.pkg"
productbuild --package-path $PKGDIR/intermediates --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ $OUTPUT_PATH/fish-$VERSION.pkg
productbuild --package-path "$PKGDIR/intermediates" --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ "$OUTPUT_PATH/fish-$VERSION.pkg"
# Make the app
( cd "$PKGDIR/build" && make fish_macapp && zip -r "$OUTPUT_PATH/fish-$VERSION.app.zip" fish.app )
{ cd "$PKGDIR/build" && make fish_macapp && zip -r "$OUTPUT_PATH/fish-$VERSION.app.zip" fish.app; }
rm -r $PKGDIR
rm -r "$PKGDIR"

View File

@@ -2,7 +2,7 @@
# Script to generate a tarball
# We use git to output a tree. But we also want to build the user documentation
# and put that in the tarball, so that nobody needs to have doxygen installed
# and put that in the tarball, so that nobody needs to have sphinx installed
# to build it.
# Outputs to $FISH_ARTEFACT_PATH or ~/fish_built by default
@@ -32,7 +32,7 @@ fi
wd="$PWD"
# Get the version from git-describe
VERSION=`git describe --dirty 2>/dev/null`
VERSION=$(git describe --dirty 2>/dev/null)
# The name of the prefix, which is the directory that you get when you untar
prefix="fish-$VERSION"
@@ -48,10 +48,10 @@ rm -f "$path" "$path".gz
git archive --format=tar --prefix="$prefix"/ HEAD > "$path"
# tarball out the documentation, generate a version file
PREFIX_TMPDIR=`mktemp -d`
cd $PREFIX_TMPDIR
echo $VERSION > version
cmake $wd
PREFIX_TMPDIR=$(mktemp -d)
cd "$PREFIX_TMPDIR"
echo "$VERSION" > version
cmake "$wd"
make doc
TAR_APPEND="$TAR --append --file=$path --mtime=now --owner=0 --group=0 \

View File

@@ -5,7 +5,8 @@
#
set git_clang_format no
set c_files
set f_files
set fish_files
set python_files
set all no
if test "$argv[1]" = "--all"
@@ -22,15 +23,13 @@ if test $all = yes
set files (git status --porcelain --short --untracked-files=all | sed -e 's/^ *[^ ]* *//')
if set -q files[1]
echo
echo You have uncommited changes. Cowardly refusing to restyle the entire code base.
echo You have uncommitted changes. Cowardly refusing to restyle the entire code base.
echo
exit 1
end
set c_files src/*.h src/*.cpp src/*.c
# For now we don't restyle all fish scripts other than completion scripts. That's because people
# really like to vertically align the elements of the `complete` command and fish_indent
# currently does not honor that whitespace.
set f_files (printf '%s\n' share/***.fish | grep -v /completions/)
set fish_files (printf '%s\n' share/***.fish)
set python_files **.py
else
# We haven't been asked to reformat all the source. If there are uncommitted changes reformat
# those using `git clang-format`. Else reformat the files in the most recent commit.
@@ -49,17 +48,20 @@ else
test -f $file; and set c_files $c_files $file
end
# Extract just the fish files.
set f_files (string match -r '^.*\.fish$' -- $files)
set fish_files (string match -r '^.*\.fish$' -- $files)
set python_files (string match -r '^.*\.py$' -- $files)
end
set -l red (set_color red)
set -l green (set_color green)
set -l blue (set_color blue)
set -l normal (set_color normal)
# Run the C++ reformatter if we have any C++ files.
if set -q c_files[1]
if test $git_clang_format = yes
if type -q git-clang-format
echo
echo ========================================
echo Running git-clang-format
echo ========================================
echo === Running "$red"git-clang-format"$normal"
git add $c_files
git-clang-format
else
@@ -68,10 +70,7 @@ if set -q c_files[1]
echo
end
else if type -q clang-format
echo
echo ========================================
echo Running clang-format
echo ========================================
echo === Running "$red"clang-format"$normal"
for file in $c_files
cp $file $file.new # preserves mode bits
clang-format $file >$file.new
@@ -90,23 +89,22 @@ if set -q c_files[1]
end
# Run the fish reformatter if we have any fish files.
if set -q f_files[1]
if set -q fish_files[1]
if not type -q fish_indent
make fish_indent
set PATH . $PATH
end
echo
echo ========================================
echo Running fish_indent
echo ========================================
for file in $f_files
cp $file $file.new # preserves mode bits
fish_indent <$file >$file.new
if cmp --quiet $file $file.new
rm $file.new
else
echo $file was NOT correctly formatted
mv $file.new $file
end
echo === Running "$green"fish_indent"$normal"
fish_indent -w -- $fish_files
end
if set -q python_files[1]
if not type -q black
echo
echo Please install "`black`" to style python
echo
else
echo === Running "$blue"black"$normal"
black $python_files
end
end

6
cmake/Benchmark.cmake Normal file
View File

@@ -0,0 +1,6 @@
# Support for benchmarking fish.
ADD_CUSTOM_TARGET(benchmark
COMMAND ${CMAKE_SOURCE_DIR}/benchmarks/driver.sh $<TARGET_FILE:fish>
USES_TERMINAL
)

View File

@@ -4,6 +4,7 @@
# `wcstod_l` is a GNU-extension, sometimes hidden behind GNU-related defines.
# This is the case for at least Cygwin and Newlib.
LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE=1)
IF(APPLE)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-Werror=unguarded-availability" REQUIRES_UNGUARDED_AVAILABILITY)
@@ -61,6 +62,7 @@ CHECK_CXX_SYMBOL_EXISTS(futimens sys/stat.h HAVE_FUTIMENS)
CHECK_CXX_SYMBOL_EXISTS(futimes sys/time.h HAVE_FUTIMES)
CHECK_CXX_SYMBOL_EXISTS(getifaddrs ifaddrs.h HAVE_GETIFADDRS)
CHECK_CXX_SYMBOL_EXISTS(getpwent pwd.h HAVE_GETPWENT)
CHECK_CXX_SYMBOL_EXISTS(getrusage sys/resource.h HAVE_GETRUSAGE)
CHECK_CXX_SYMBOL_EXISTS(gettext libintl.h HAVE_GETTEXT)
CHECK_CXX_SYMBOL_EXISTS(killpg "sys/types.h;signal.h" HAVE_KILLPG)
CHECK_CXX_SYMBOL_EXISTS(lrand48_r stdlib.h HAVE_LRAND48_R)
@@ -127,9 +129,6 @@ IF(STRUCT_WINSIZE GREATER -1 AND HAVE_TIOCGWINSZ EQUAL 1)
ENDIF()
CMAKE_POP_CHECK_STATE()
IF(EXISTS "/proc/self/stat")
SET(HAVE__PROC_SELF_STAT 1)
ENDIF()
CHECK_TYPE_SIZE("wchar_t[8]" WCHAR_T_BITS LANGUAGE CXX)
# Solaris, NetBSD and X/Open-conforming systems have a fixed-args tparm
@@ -178,6 +177,15 @@ int main () {
ENDIF()
CMAKE_POP_CHECK_STATE()
# Work around the fact that cmake does not propagate the language standard flag into
# the CHECK_CXX_SOURCE_COMPILES function. See CMake issue #16456.
# Ensure we do this after the FIND_PACKAGE calls which use C, and will error on a C++
# standards flag.
# Also see https://github.com/fish-shell/fish-shell/issues/5865
IF(NOT POLICY CMP0067)
LIST(APPEND CMAKE_REQUIRED_FLAGS "${CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION}")
ENDIF()
CHECK_CXX_SOURCE_COMPILES("
#include <memory>
@@ -189,3 +197,15 @@ int main () {
)
FIND_PROGRAM(SED sed)
CHECK_CXX_SOURCE_COMPILES("
#include <atomic>
#include <cstdint>
std::atomic<uint64_t> x;
int main() {
return x;
}"
LIBATOMIC_NOT_NEEDED)
IF (NOT LIBATOMIC_NOT_NEEDED)
SET(ATOMIC_LIBRARY "atomic")
ENDIF()

View File

@@ -13,25 +13,33 @@ SET(SPHINX_CACHE_DIR "${SPHINX_ROOT_DIR}/doctrees")
SET(SPHINX_HTML_DIR "${SPHINX_ROOT_DIR}/html")
SET(SPHINX_MANPAGE_DIR "${SPHINX_ROOT_DIR}/man")
CONFIGURE_FILE("${SPHINX_SRC_DIR}/conf.py" "${SPHINX_BUILD_DIR}/conf.py" @ONLY)
# sphinx-docs uses fish_indent for highlighting.
# Prepend the output dir of fish_indent to PATH.
ADD_CUSTOM_TARGET(sphinx-docs
${SPHINX_EXECUTABLE}
mkdir -p ${SPHINX_HTML_DIR}/_static/
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SPHINX_SRC_DIR}/_static/pygments.css ${SPHINX_HTML_DIR}/_static/
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SPHINX_SRC_DIR}/_static/custom.css ${SPHINX_HTML_DIR}/_static/
COMMAND env PATH="$<TARGET_FILE_DIR:fish_indent>:$$PATH"
${SPHINX_EXECUTABLE}
-q -b html
-c "${SPHINX_SRC_DIR}"
-d "${SPHINX_CACHE_DIR}"
"${SPHINX_SRC_DIR}"
"${SPHINX_HTML_DIR}"
DEPENDS sphinx_doc_src/fish_indent_lexer.py fish_indent
COMMENT "Building HTML documentation with Sphinx")
# sphinx-manpages needs the fish_indent binary for the version number
ADD_CUSTOM_TARGET(sphinx-manpages
${SPHINX_EXECUTABLE}
env PATH="$<TARGET_FILE_DIR:fish_indent>:$$PATH"
${SPHINX_EXECUTABLE}
-q -b man
-c "${SPHINX_SRC_DIR}"
-d "${SPHINX_CACHE_DIR}"
"${SPHINX_SRC_DIR}"
# TODO: This only works if we only have section 1 manpages.
"${SPHINX_MANPAGE_DIR}/man1"
DEPENDS fish_indent
COMMENT "Building man pages with Sphinx")
IF(SPHINX_EXECUTABLE)
@@ -45,7 +53,7 @@ IF(BUILD_DOCS AND NOT SPHINX_EXECUTABLE)
ENDIF()
IF(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/user_doc/html
AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/share/man/man1)
AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/user_doc/man)
SET(HAVE_PREBUILT_DOCS TRUE)
ELSE()
SET(HAVE_PREBUILT_DOCS FALSE)
@@ -60,6 +68,7 @@ ENDIF()
ADD_FEATURE_INFO(Documentation INSTALL_DOCS "user manual and documentation")
IF(BUILD_DOCS)
CONFIGURE_FILE("${SPHINX_SRC_DIR}/conf.py" "${SPHINX_BUILD_DIR}/conf.py" @ONLY)
ADD_CUSTOM_TARGET(doc ALL
DEPENDS sphinx-docs sphinx-manpages)
@@ -71,9 +80,6 @@ ELSEIF(HAVE_PREBUILT_DOCS)
IF(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# Out of tree build - link the prebuilt documentation to the build tree
ADD_CUSTOM_TARGET(link_doc ALL)
ADD_CUSTOM_COMMAND(TARGET link_doc
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/share/man ${CMAKE_CURRENT_BINARY_DIR}/share/man
POST_BUILD)
ADD_CUSTOM_COMMAND(TARGET link_doc
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/user_doc ${CMAKE_CURRENT_BINARY_DIR}/user_doc
POST_BUILD)

View File

@@ -25,37 +25,37 @@ SET(configure_input
DO NOT MANUALLY EDIT THIS FILE!")
SET(extra_completionsdir
${datadir}/fish/vendor_completions.d
/usr/local/share/fish/vendor_completions.d
CACHE STRING "Path for extra completions")
SET(extra_functionsdir
${datadir}/fish/vendor_functions.d
CACHE STRING "Path for extra completions")
/usr/local/share/fish/vendor_functions.d
CACHE STRING "Path for extra functions")
SET(extra_confdir
${datadir}/fish/vendor_conf.d
/usr/local/share/fish/vendor_conf.d
CACHE STRING "Path for extra configuration")
# These are the man pages that go in system manpath; all manpages go in the fish-specific manpath.
SET(MANUALS ${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish.1
${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish_indent.1
${CMAKE_CURRENT_BINARY_DIR}/share/man/man1/fish_key_reader.1)
SET(MANUALS ${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish.1
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish_indent.1
${CMAKE_CURRENT_BINARY_DIR}/user_doc/man/man1/fish_key_reader.1)
# Determine which man page we don't want to install.
# On OS X, don't install a man page for open, since we defeat fish's open
# function on OS X.
# On other operating systems, don't install a realpath man page, as they almost all have a realpath
# command, while macOS does not.
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(CONDEMNED_PAGE "open.1")
ELSE()
SET(CONDEMNED_PAGE "none")
SET(CONDEMNED_PAGE "realpath.1")
ENDIF()
# Define a function to help us create directories.
FUNCTION(FISH_CREATE_DIRS)
FOREACH(dir ${ARGV})
IF(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/${dir})
INSTALL(DIRECTORY DESTINATION ${dir})
ENDIF()
INSTALL(DIRECTORY DESTINATION ${dir})
ENDFOREACH(dir)
ENDFUNCTION(FISH_CREATE_DIRS)
@@ -113,13 +113,13 @@ INSTALL(FILES share/config.fish
# -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir)
# -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir)
# -$v $(INSTALL) -m 755 -d $(DESTDIR)$(extra_confdir)
FISH_CREATE_DIRS(${rel_datadir}/pkgconfig)
# Don't try too hard to create these directories as they may be outside our writeable area
# https://github.com/Homebrew/homebrew-core/pull/2813
FISH_TRY_CREATE_DIRS(${extra_completionsdir} ${extra_functionsdir} ${extra_confdir})
# Create only the vendor directories inside the prefix (#5029 / #6508)
FISH_CREATE_DIRS(${rel_datadir}/fish/vendor_completions.d ${rel_datadir}/fish/vendor_functions.d
${rel_datadir}/fish/vendor_conf.d)
# @echo "Installing pkgconfig file"
# $v $(INSTALL) -m 644 fish.pc $(DESTDIR)$(datadir)/pkgconfig
FISH_TRY_CREATE_DIRS(${rel_datadir}/pkgconfig)
CONFIGURE_FILE(fish.pc.in fish.pc.noversion)
ADD_CUSTOM_COMMAND(OUTPUT fish.pc
@@ -187,7 +187,7 @@ INSTALL(DIRECTORY share/tools/web_config
# $(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \
# true; \
# done;
# Building the man pages is optional: if doxygen isn't installed, they're not built
# Building the man pages is optional: if Sphinx isn't installed, they're not built
INSTALL(FILES ${MANUALS} DESTINATION ${mandir}/man1/ OPTIONAL)
#install-doc: $(user_doc)
@@ -218,7 +218,7 @@ ENDIF()
# Group install targets into a InstallTargets folder
SET_PROPERTY(TARGET build_fish_pc CHECK-FISH-BUILD-VERSION-FILE
test_invocation test_fishscript
test_fishscript
test_prep tests_buildroot_target
PROPERTY FOLDER cmake/InstallTargets)

View File

@@ -26,32 +26,22 @@ IF(NOT FISH_IN_TREE_BUILD)
ADD_DEPENDENCIES(fish_tests tests_dir)
ENDIF()
# Create the 'test' target.
# Set a policy so CMake stops complaining about the name 'test'.
CMAKE_POLICY(PUSH)
IF(POLICY CMP0037)
CMAKE_POLICY(SET CMP0037 OLD)
ENDIF()
ADD_CUSTOM_TARGET(test)
CMAKE_POLICY(POP)
ADD_CUSTOM_TARGET(test_low_level
COMMAND env XDG_DATA_HOME=test/data XDG_CONFIG_HOME=test/home ./fish_tests
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS fish_tests
USES_TERMINAL)
ADD_DEPENDENCIES(test test_low_level tests_dir)
# Copy littlecheck.py
CONFIGURE_FILE(build_tools/littlecheck.py littlecheck.py COPYONLY)
# Make the directory in which to run tests.
# Also symlink fish to where the tests expect it to be.
# Lastly put fish_test_helper there too.
ADD_CUSTOM_TARGET(tests_buildroot_target
COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_INSTALL_DIR}
COMMAND DESTDIR=${TEST_INSTALL_DIR} ${CMAKE_COMMAND}
--build ${CMAKE_CURRENT_BINARY_DIR} --target install
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/fish_test_helper
${TEST_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}/bin
COMMAND ${CMAKE_COMMAND} -E create_symlink
${TEST_INSTALL_DIR}/${CMAKE_INSTALL_PREFIX}
${TEST_ROOT_DIR}
DEPENDS fish)
DEPENDS fish fish_test_helper)
IF(NOT FISH_IN_TREE_BUILD)
# We need to symlink share/functions for the tests.
@@ -65,67 +55,68 @@ ELSE()
ADD_CUSTOM_TARGET(symlink_functions)
ENDIF()
#
# Prep the environment for running the unit tests.
# test-prep: show-DESTDIR show-LN_S show-FISH_VERSION
# $v rm -rf test
# $v $(MKDIR_P) test/data test/home test/temp
# ifdef DESTDIR
# $v $(LN_S) $(DESTDIR) test/root
# else
# $v $(MKDIR_P) test/root
# endif
ADD_CUSTOM_TARGET(test_prep
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/data
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/home
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TEST_DIR}/temp
COMMAND ${CMAKE_COMMAND} -E make_directory
${TEST_DIR}/data ${TEST_DIR}/home ${TEST_DIR}/temp
DEPENDS tests_buildroot_target
DEPENDS tests_buildroot_target tests_dir
USES_TERMINAL)
# test_high_level_test_deps = test_fishscript test_interactive test_invocation
# test_high_level: DESTDIR = $(PWD)/test/root/
# test_high_level: prefix = .
# test_high_level: test-prep install-force test_fishscript test_interactive test_invocation
# .PHONY: test_high_level
#
# test_invocation: $(call filter_up_to,test_invocation,$(active_test_goals))
# cd tests; ./invocation.sh
# .PHONY: test_invocation
ADD_CUSTOM_TARGET(test_invocation
COMMAND ./invocation.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tests/
DEPENDS test_prep test_low_level
USES_TERMINAL)
#
# test_fishscript: $(call filter_up_to,test_fishscript,$(active_test_goals))
# cd tests; ../test/root/bin/fish test.fish
# .PHONY: test_fishscript
ADD_CUSTOM_TARGET(test_fishscript
COMMAND cd tests && ${TEST_ROOT_DIR}/bin/fish test.fish
DEPENDS test_prep test_invocation
USES_TERMINAL)
#
# test_interactive: $(call filter_up_to,test_interactive,$(active_test_goals))
# cd tests; ../test/root/bin/fish interactive.fish
# .PHONY: test_interactive
ADD_CUSTOM_TARGET(test_interactive
COMMAND cd tests && ${TEST_ROOT_DIR}/bin/fish interactive.fish
DEPENDS test_prep test_invocation test_fishscript
# Define our individual tests.
# Each test is conceptually independent.
# However when running all tests, we want to run them serially for sanity's sake.
# So define both a normal target, and a serial variant which enforces ordering.
FOREACH(TESTTYPE test serial_test)
ADD_CUSTOM_TARGET(${TESTTYPE}_low_level
COMMAND env XDG_DATA_HOME=test/data XDG_CONFIG_HOME=test/home ./fish_tests
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS fish_tests
USES_TERMINAL)
ADD_CUSTOM_TARGET(test_high_level
DEPENDS test_invocation test_fishscript test_interactive)
ADD_DEPENDENCIES(test test_high_level)
ADD_CUSTOM_TARGET(${TESTTYPE}_fishscript
COMMAND cd tests && ${TEST_ROOT_DIR}/bin/fish test.fish
DEPENDS test_prep
USES_TERMINAL)
ADD_CUSTOM_TARGET(${TESTTYPE}_interactive
COMMAND cd tests && ${TEST_ROOT_DIR}/bin/fish interactive.fish
DEPENDS test_prep
USES_TERMINAL)
ENDFOREACH(TESTTYPE)
# Now add a dependency chain between the serial versions.
# This ensures they run in order.
ADD_DEPENDENCIES(serial_test_fishscript serial_test_low_level)
ADD_DEPENDENCIES(serial_test_interactive serial_test_fishscript)
ADD_CUSTOM_TARGET(serial_test_high_level
DEPENDS serial_test_interactive serial_test_fishscript)
# Create the 'test' target.
# Set a policy so CMake stops complaining about the name 'test'.
CMAKE_POLICY(PUSH)
IF(${CMAKE_VERSION} VERSION_LESS 3.11.0 AND POLICY CMP0037)
CMAKE_POLICY(SET CMP0037 OLD)
ENDIF()
ADD_CUSTOM_TARGET(test)
CMAKE_POLICY(POP)
ADD_DEPENDENCIES(test serial_test_high_level)
# Group test targets into a TestTargets folder
SET_PROPERTY(TARGET test test_low_level test_high_level tests_dir
test_invocation test_fishscript test_prep
SET_PROPERTY(TARGET test tests_dir
test_low_level
test_fishscript
test_interactive
test_fishscript test_prep
tests_buildroot_target
serial_test_high_level
serial_test_low_level
serial_test_fishscript
serial_test_interactive
symlink_functions
PROPERTY FOLDER cmake/TestTargets)

1438
config.guess vendored

File diff suppressed because it is too large Load Diff

1810
config.sub vendored

File diff suppressed because it is too large Load Diff

View File

@@ -31,6 +31,9 @@
/* Define to 1 if you have the `getpwent' function. */
#cmakedefine HAVE_GETPWENT 1
/* Define to 1 if you have the 'getrusage' function. */
#cmakedefine HAVE_GETRUSAGE 1
/* Define to 1 if you have the `gettext' function. */
#cmakedefine HAVE_GETTEXT 1
@@ -124,8 +127,8 @@
/* Define to 1 if the _nl_msg_cat_cntr symbol is exported. */
#cmakedefine HAVE__NL_MSG_CAT_CNTR 1
/* Define to 1 if you have the file `/proc/self/stat'. */
#cmakedefine HAVE__PROC_SELF_STAT 1
/* Define to 1 if std::make_unique is available. */
#cmakedefine HAVE_STD__MAKE_UNIQUE 1
/* Define to 1 if the _sys_errs array is available. */
#cmakedefine HAVE__SYS__ERRS 1
@@ -142,7 +145,7 @@
/* Define to the full name of this package. */
#define PACKAGE_NAME "fish"
/* Define to 1 if tparm accepts a fixed amount of paramters. */
/* Define to 1 if tparm accepts a fixed amount of parameters. */
#cmakedefine TPARM_SOLARIS_KLUDGE 1
/* Enable GNU extensions on systems that have them. */
@@ -165,14 +168,6 @@
#ifndef __warn_unused
#define __warn_unused __attribute__ ((warn_unused_result))
#endif
#ifndef __sentinel
#define __sentinel __attribute__ ((sentinel))
#endif
#ifndef __packed
#define __packed __attribute__ ((packed))
#endif
#else
#define __warn_unused
#define __sentinel
#define __packed
#endif

View File

@@ -1,744 +0,0 @@
#
# This file is the main build configuration file for fish. It is used
# to determine your systems capabilities, and tries to adapt fish to
# take maximum advantage of the services your system offers.
#
# Process this file using the 'autoconf' command to produce a working
# configure script, which should in turn be executed in order to
# configure the build process.
#
m4_syscmd([build_tools/git_version_gen.sh 2>/dev/null])
AC_PREREQ([2.60])
AC_INIT(fish,
m4_esyscmd([cut -f 2 -d '=' FISH-BUILD-VERSION-FILE | tr -d '"\n']),
https://github.com/fish-shell/fish-shell/issues)
ac_clean_files=a.out.dSYM
#
# List of output variables produced by this configure script
#
AC_SUBST(HAVE_GETTEXT)
AC_SUBST(HAVE_DOXYGEN)
AC_SUBST(LDFLAGS_FISH)
AC_SUBST(WCHAR_T_BITS)
AC_SUBST(EXTRA_PCRE2)
AC_SUBST(HAVE_BROKEN_WCWIDTH)
#
# If needed, run autoconf to regenerate the configure file
#
# This makes sure that after running autoconf once to create the first
# version of configure, we never again need to worry about manually
# running autoconf to handle an updates configure.ac.
#
AC_MSG_CHECKING([if autoreconf needs to be run])
if test configure -ot configure.ac; then
AC_MSG_RESULT([yes])
if command -v autoreconf >/dev/null; then
# No need to provide any error messages if autoreconf fails, the
# shell and autconf should take care of that themselves
AC_MSG_NOTICE([running autoreconf --no-recursive])
if autoreconf --no-recursive; then
./configure "$@"
exit
fi
exit 1
else
AC_MSG_ERROR(
[cannot find the autoreconf program in your path.
This program needs to be run whenever the configure.ac file is modified.
Please install autoreconf and try again.]
)
fi
else
AC_MSG_RESULT([no])
fi
#
# If needed, run autoheader to regenerate config.h.in
#
# This makes sure we never ever have to run autoheader manually. It
# will be run whenever needed automatically.
#
AC_MSG_CHECKING([if autoheader needs to be run])
if test ! -f ./config.h.in -o config.h.in -ot configure.ac; then
AC_MSG_RESULT([yes])
if command -v autoheader >/dev/null; then
AC_MSG_NOTICE([running autoheader])
autoheader || exit 1
else
AC_MSG_ERROR(
[cannot find the autoheader program in your path.
This program needs to be run whenever the configure.ac file is modified.
Please install autotools and try again.]
)
fi
else
AC_MSG_RESULT([no])
fi
#
# Include the autoconf macros directory
#
AC_CONFIG_MACRO_DIRS([m4])
#
# Set up various programs needed for install
# Note AC_PROG_CXX sets CXXFLAGS if not set, which we want
# So ensure this happens before we modify CXXFLAGS below
# Do CC also, because PCRE2 will use it.
AC_PROG_CC
AC_PROG_CC_STDC # c99
AC_PROG_CXX
AC_LANG(C++)
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_AWK
AC_PROG_FGREP
AC_PROG_SED
AC_USE_SYSTEM_EXTENSIONS
AX_CXX_COMPILE_STDCXX_11(noext,mandatory)
#
# Tell autoconf to create config.h header
#
AC_CONFIG_HEADERS(config.h)
AC_CANONICAL_HOST
#
# This adds markup to the code that results in a few extra compile
# time checks on recent GCC versions. It helps stop a few common bugs.
#
AH_BOTTOM([#if __GNUC__ >= 3
#ifndef __warn_unused
#define __warn_unused __attribute__ ((warn_unused_result))
#endif
#ifndef __sentinel
#define __sentinel __attribute__ ((sentinel))
#endif
#ifndef __packed
#define __packed __attribute__ ((packed))
#endif
#else
#define __warn_unused
#define __sentinel
#define __packed
#endif])
#
# Optionally drop gettext support
#
AC_ARG_WITH(
gettext,
AS_HELP_STRING(
[--without-gettext],
[do not translate messages, even if gettext is available]
),
[local_gettext=$withval],
[local_gettext=check]
)
AS_IF([test x$local_gettext != xno],
[ AC_CHECK_PROGS( [found_msgfmt], [msgfmt], [no] )
if test x$found_msgfmt != xno; then
AC_DEFINE([USE_GETTEXT],[1],[Perform string translations with gettext])
elif test "x$local_gettext" != "xcheck" ; then
AC_MSG_FAILURE([--with-gettext was given, but the msgfmt program could not be found])
else
local_gettext=no
fi
],
)
#
# Build/clean the documentation only if Doxygen is available
#
doxygen_minimum=1.8.7
AC_ARG_WITH(
doxygen,
AS_HELP_STRING(
[--with-doxygen],
[use Doxygen to regenerate documentation]
),
[use_doxygen=$withval],
[use_doxygen=auto]
)
AS_IF([test "$use_doxygen" != "no"],
[
AC_CHECK_PROGS([found_doxygen], [doxygen], [no])
if test "$found_doxygen" != no; then
# test version
AC_MSG_CHECKING([the doxygen version])
doxygen_version=`doxygen --version 2>/dev/null`
AC_MSG_RESULT([$doxygen_version])
dnl This requires autoconf 2.60 or newer
AS_VERSION_COMPARE([$doxygen_version], [$doxygen_minimum],
[ if test "$use_doxygen" = auto; then
AC_MSG_WARN([doxygen version $doxygen_version found, but $doxygen_minimum required])
HAVE_DOXYGEN=0
else
AC_MSG_FAILURE([doxygen version $doxygen_version found, but $doxygen_minimum required])
fi
],
[HAVE_DOXYGEN=1], [HAVE_DOXYGEN=1])
elif test "$use_doxygen" != auto; then
AC_MSG_FAILURE([--with-doxygen was given, but the doxygen program could not be found])
else
HAVE_DOXYGEN=0
fi
],
)
#
# Try to enable large file support. This will make sure that on systems
# where off_t can be either 32 or 64 bit, the latter size is used. On
# other systems, this should do nothing. (Hopefully)
#
AC_SYS_LARGEFILE
# Fish does not use exceptions.
CXXFLAGS="$CXXFLAGS -fno-exceptions"
#
# Set some warning flags
# Don't warn about missing field initializers, it has too many
# false positives for code like `struct termios tmodes = {};`
#
CXXFLAGS="$CXXFLAGS -Wextra -Wno-missing-field-initializers"
#
# This is needed in order to get the really cool backtraces on Linux
#
AC_MSG_CHECKING([for -rdynamic linker flag])
prev_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -rdynamic"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[
AC_MSG_RESULT([yes])
LDFLAGS_FISH="$LDFLAGS_FISH -rdynamic"
], [
AC_MSG_RESULT([no])
LDFLAGS_FISH="$LDFLAGS_FISH"
])
LDFLAGS="$prev_LDFLAGS"
#
# See if Linux procfs is present. This is used to get extra
# information about running processes.
#
AC_CHECK_FILES([/proc/self/stat])
# Disable curses macros that conflict with the STL
AC_DEFINE([NCURSES_NOMACROS], [1], [Define to 1 to disable ncurses macros that conflict with the STL])
AC_DEFINE([NOMACROS], [1], [Define to 1 to disable curses macros that conflict with the STL])
# Threading is excitingly broken on Solaris without adding -pthread to CXXFLAGS
# Only support GCC for now
dnl Ideally we would use the AX_PTHREAD macro here, but it's GPL3-licensed
dnl ACX_PTHREAD is way too old and seems to break the OS X build
dnl Both only check with AC_LANG(C) in any case
case $host_os in
solaris*)
CXXFLAGS="$CXXFLAGS -pthread"
CFLAGS="$CFLAGS -pthread"
;;
esac
#
# Check presense of various libraries. This is done on a per-binary
# level, since including various extra libraries in all binaries only
# because thay are used by some of them can cause extra bloat and
# slower compiles when developing fish.
#
# Check for os dependant libraries for all binaries.
AC_SEARCH_LIBS( nanosleep, rt, , [AC_MSG_ERROR([Cannot find the rt library, needed to build this package.] )] )
AC_SEARCH_LIBS( shm_open, rt, [AC_DEFINE([HAVE_SHM_OPEN], [1], [Define to 1 if the shm_open() function exists])] )
AC_SEARCH_LIBS( pthread_create, pthread, , [AC_MSG_ERROR([Cannot find the pthread library, needed to build this package.] )] )
AC_SEARCH_LIBS( setupterm, [ncurses tinfo curses], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish. If this is Linux, try running 'sudo apt-get install libncurses5-dev' or 'sudo yum install ncurses-devel'])] )
AC_SEARCH_LIBS( [dladdr], [dl] )
if test x$local_gettext != xno; then
AC_SEARCH_LIBS( gettext, intl,,)
fi
#
# Check presense of various header files
#
AC_CHECK_HEADERS([getopt.h termios.h sys/resource.h term.h ncurses/term.h ncurses.h ncurses/curses.h curses.h stropts.h siginfo.h sys/select.h sys/ioctl.h execinfo.h spawn.h sys/sysctl.h xlocale.h])
if test x$local_gettext != xno; then
AC_CHECK_HEADERS([libintl.h])
fi
#
# Get the size in bits of wchar_t, needed for configuring the pcre2 build
# and for code that #includes pcre2.h
#
AC_CHECK_SIZEOF(wchar_t)
WCHAR_T_BITS=`expr 8 \* $ac_cv_sizeof_wchar_t`
AC_DEFINE_UNQUOTED([WCHAR_T_BITS], [$WCHAR_T_BITS], [The size of wchar_t in bits.])
#
# Detect nanoseconds fields in struct stat
#
AC_CHECK_MEMBERS([struct stat.st_ctime_nsec])
AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec])
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])
#
# Check for D_TYPE in dirent, only on BSD and Linux
#
AC_STRUCT_DIRENT_D_TYPE
#
# Check for presence of various functions used by fish
#
AC_CHECK_FUNCS( wcsndup )
AC_CHECK_FUNCS( wcstod_l )
AC_CHECK_FUNCS( futimes )
AC_CHECK_FUNCS( wcslcpy lrand48_r killpg )
AC_CHECK_FUNCS( backtrace_symbols getifaddrs )
AC_CHECK_FUNCS( futimens clock_gettime )
AC_CHECK_FUNCS( getpwent flock )
AC_MSG_CHECKING([dirfd])
AC_LINK_IFELSE([
AC_LANG_PROGRAM(
[
#include <dirent.h>
DIR *dirp;
], [
return dirfd(dirp);
]
)
]
, [ AC_MSG_RESULT([yes])
AC_DEFINE([HAVE_DIRFD], 1, [ Define to 1 if you have the `dirfd' function or macro. ])
],
[ AC_MSG_RESULT([no])]
)
AC_CHECK_DECL( [__NetBSD__], AC_DEFINE([TPARM_VARARGS], 1, [ Make tparm take varargs ]) )
AC_CHECK_DECL( [mkostemp], [ AC_CHECK_FUNCS([mkostemp]) ] )
#
# Although setupterm is linkable thanks to SEARCH_LIBS above, some
# builds of ncurses include the actual headers in a different package
#
AC_CHECK_DECL( [setupterm], , [AC_MSG_ERROR([Could not find a curses implementation, needed to build fish. If this is Linux, try running 'sudo apt-get install libncurses5-dev' or 'sudo yum install ncurses-devel'])], [
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
#include <curses.h>
#endif
#if HAVE_TERM_H
#include <term.h>
#elif HAVE_NCURSES_TERM_H
#include <ncurses/term.h>
#endif
] )
dnl AC_CHECK_FUNCS uses C linkage, but sometimes (Solaris!) the behaviour is
dnl different with C++.
AC_MSG_CHECKING([for wcsdup])
AC_TRY_LINK( [ #include <wchar.h> ],
[ wchar_t* foo = wcsdup(L""); ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_WCSDUP, 1, Define to 1 if you have the `wcsdup' function.)
],
[AC_MSG_RESULT(no)],
)
AC_MSG_CHECKING([for std::wcsdup])
AC_TRY_LINK( [ #include <wchar.h> ],
[ wchar_t* foo = std::wcsdup(L""); ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STD__WCSDUP, 1, Define to 1 if you have the `std::wcsdup' function.)
],
[AC_MSG_RESULT(no)],
)
AC_MSG_CHECKING([for wcscasecmp])
AC_TRY_LINK( [ #include <wchar.h> ],
[ int foo = wcscasecmp(L"", L""); ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_WCSCASECMP, 1, Define to 1 if you have the `wcscasecmp' function.)
],
[AC_MSG_RESULT(no)],
)
AC_MSG_CHECKING([for std::wcscasecmp])
AC_TRY_LINK( [ #include <wchar.h> ],
[ int foo = std::wcscasecmp(L"", L""); ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STD__WCSCASECMP, 1, Define to 1 if you have the `std::wcscasecmp' function.)
],
[AC_MSG_RESULT(no)],
)
AC_MSG_CHECKING([for wcsncasecmp])
AC_TRY_LINK( [ #include <wchar.h> ],
[ int foo = wcsncasecmp(L"", L"", 0); ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_WCSNCASECMP, 1, Define to 1 if you have the `wcsncasecmp' function.)
],
[AC_MSG_RESULT(no)],
)
AC_MSG_CHECKING([for std::wcsncasecmp])
AC_TRY_LINK( [ #include <wchar.h> ],
[ int foo = std::wcsncasecmp(L"", L"", 0); ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STD__WCSNCASECMP, 1, Define to 1 if you have the `std::wcsncasecmp' function.)
],
[AC_MSG_RESULT(no)],
)
AC_MSG_CHECKING([for std::make_unique])
AC_TRY_LINK( [ #include <memory> ],
[ std::unique_ptr<int> foo = std::make_unique<int>(); ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STD__MAKE_UNIQUE, 1, Define to 1 if you have the `std::make_unique' function.)
],
[AC_MSG_RESULT(no)],
)
if test x$local_gettext != xno; then
AC_CHECK_FUNCS( gettext )
#
# The Makefile also needs to know if we have gettext, so it knows if
# the translations should be installed.
#
AC_CHECK_FUNC( gettext, HAVE_GETTEXT=1, HAVE_GETTEXT=0 )
fi
#
# Here follows a list of small programs used to test for various
# features that Autoconf doesn't tell us about
#
dnl AC_CHECK_FUNCS uses C linkage, but sometimes (Solaris!) the behaviour is
dnl different with C++.
AC_MSG_CHECKING([if ctermid_r() available])
AC_TRY_LINK( [ #include <stdio.h> ],
[ char buf[L_ctermid]; char *foo = ctermid_r(buf); ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CTERMID_R, 1, Define to 1 if you have the `ctermid_r' function.)
],
[AC_MSG_RESULT(no)],
)
#
# Check if struct winsize and TIOCGWINSZ exist
#
AC_MSG_CHECKING([if struct winsize and TIOCGWINSZ exist])
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
],
[
struct winsize termsize = {0};
TIOCGWINSZ;
]
)
],
[
AC_MSG_RESULT(yes);
AC_DEFINE([HAVE_WINSIZE], [1], [Define to 1 if the winsize struct and TIOCGWINSZ macro exist])
],
[
AC_MSG_RESULT(no)
]
)
# Check for _nl_msg_cat_cntr symbol
AC_MSG_CHECKING([for _nl_msg_cat_cntr symbol])
AC_TRY_LINK(
[
#if HAVE_LIBINTL_H
#include <libintl.h>
#endif
#include <stdlib.h>
],
[
extern int _nl_msg_cat_cntr;
int tmp = _nl_msg_cat_cntr;
exit(tmp);
],
have__nl_msg_cat_cntr=yes,
have__nl_msg_cat_cntr=no
)
if test "$have__nl_msg_cat_cntr" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(
[HAVE__NL_MSG_CAT_CNTR],
[1],
[Define to 1 if the _nl_msg_cat_cntr symbol is exported.]
)
else
AC_MSG_RESULT(no)
fi
# Check for sys_errlist
AC_MSG_CHECKING([for sys_errlist array])
AC_TRY_LINK(
[
#include <stdio.h>
],
[
const char *p;
p = sys_errlist[sys_nerr];
],
have_sys_errlist=yes,
have_sys_errlist=no
)
if test "$have_sys_errlist" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(
[HAVE_SYS_ERRLIST],
[1],
[Define to 1 if the sys_errlist array is available.]
)
else
AC_MSG_RESULT(no)
fi
# Check for _sys_errs
AC_MSG_CHECKING([for _sys_errs array])
AC_TRY_LINK(
[
#include <string>
],
[
std::string p;
extern const char _sys_errs[];
extern const int _sys_index[];
p = _sys_errs[_sys_index[0]];
],
have__sys__errs=yes,
have__sys__errs=no
)
if test "$have__sys__errs" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(
[HAVE__SYS__ERRS],
[1],
[Define to 1 if the _sys_errs array is available.]
)
else
AC_MSG_RESULT(no)
fi
# Check for Solaris curses tputs having fixed length parameter list.
AC_MSG_CHECKING([if we are using non varargs tparm.])
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[
#define TPARM_VARARGS 1
#if HAVE_NCURSES_H
#include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h>
#else
#include <curses.h>
#endif
#if HAVE_TERM_H
#include <term.h>
#elif HAVE_NCURSES_TERM_H
#include <ncurses/term.h>
#endif
],
[
tparm( "" );
]
)
],
[tparm_solaris_kludge=no],
[tparm_solaris_kludge=yes]
)
if test "x$tparm_solaris_kludge" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(
[TPARM_SOLARIS_KLUDGE],
[1],
[Define to 1 if tparm accepts a fixed amount of paramters.]
)
else
AC_MSG_RESULT(no)
fi
# ========
# PCRE2 library configuration.
pcre2_min_version=10.21
EXTRA_PCRE2=
AC_ARG_WITH(
included-pcre2,
AS_HELP_STRING(
[--without-included-pcre2],
[build against the system PCRE2 library instead of the bundled version]
),
[included_pcre2=$withval],
[included_pcre2=auto]
)
HAVE_BROKEN_WCWIDTH=
AC_ARG_ENABLE(
[wcwidth],
AS_HELP_STRING(
[--disable-internal-wcwidth],
[use system wcwidth instead of the bundled version]
))
if test "x$enable_wcwidth" != "xno"; then
AC_DEFINE([HAVE_BROKEN_WCWIDTH], [1], [banana])
else
AC_DEFINE([HAVE_BROKEN_WCWIDTH], [0], [banana])
fi
if test "x$included_pcre2" != "xyes"; then
# test for pcre2-config
# can use either pcre2-config or pkgconfig here but only implement the former for now
AC_CHECK_PROG(PCRE2_CONFIG, pcre2-config, pcre2-config)
if test "x$PCRE2_CONFIG" != "x"; then
dnl AC_MSG_CHECKING([for $WCHAR_T_BITS-bit PCRE2])
XLIBS="$LIBS"
LIBS="$LIBS "`$PCRE2_CONFIG --libs$WCHAR_T_BITS 2>/dev/null`
XCXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS "`$PCRE2_CONFIG --cflags`
# cheat a bit here. the exact library is determined by $WCHAR_T_BITS,
# and so AC_CHECK_LIB won't work (can't use a variable as library name)
# AC_SEARCH_LIBS will use the existing $LIBS flags with no additional library first
AC_SEARCH_LIBS([pcre2_compile_$WCHAR_T_BITS], [],
[ # pcre2 lib found, check for minimum version
pcre2_version=`$PCRE2_CONFIG --version`
AS_VERSION_COMPARE([$pcre2_version], [$pcre2_min_version],
[ # version < minimum
AC_MSG_NOTICE([system PCRE2 library version $pcre2_version, need $pcre2_min_version or later])
if test "x$included_pcre2" = "xno"; then
# complain about pcre2 version
AC_MSG_ERROR([system PCRE2 library is too old, but --without-included-pcre2 was given.])
else
# use the internal version; undo changes to LIBS/CXXFLAGS
included_pcre2=yes
LIBS="$XLIBS"
CXXFLAGS="$XCXXFLAGS"
fi
],
[ # version == minimum
working_pcre2=yes
],
[ # version > minimum
working_pcre2=yes
]
)
],
[ # fail case; undo the changes to LIBS/CXXFLAGS
working_pcre2=no
LIBS="$XLIBS"
CXXFLAGS="$XCXXFLAGS"
]
)
fi
if test "x$working_pcre2" = "xyes"; then
AC_MSG_NOTICE([using system PCRE2 library])
else
# pcre2 size wrong or pcre2-config not found
# is it OK to use the included version?
if test "x$included_pcre2" = "xno"; then
# complain
AC_MSG_ERROR([cannot find system pcre2-config, but --without-included-pcre2 was given.
Make sure pcre2-config is installed and available in PATH.
You may need to install the PCRE2 development library for your system.])
else
# use the internal version
included_pcre2=yes
fi
fi
fi
# Re-test as value may have changed.
if test "x$included_pcre2" = "xyes"; then
# Build configure/Makefile for pcre2
AC_MSG_NOTICE([using included PCRE2 library])
# unfortunately these get added to the global configuration
ac_configure_args="$ac_configure_args --disable-pcre2-8 --enable-pcre2-$WCHAR_T_BITS --disable-shared"
AC_CONFIG_SUBDIRS([pcre2-10.32])
PCRE2_CXXFLAGS='-I$(PCRE2_DIR)/src'
PCRE2_LIBS='-L$(PCRE2_LIBDIR) -lpcre2-$(PCRE2_WIDTH)'
# Make the binary depend on the PCRE2 libraries so they get built
EXTRA_PCRE2='$(PCRE2_LIB)'
CXXFLAGS="$CXXFLAGS $PCRE2_CXXFLAGS"
LIBS="$LIBS $PCRE2_LIBS"
fi
# Allow configurable extra directories.
AC_SUBST(extra_completionsdir)
AC_ARG_WITH([extra-completionsdir],
AS_HELP_STRING([--with-extra-completionsdir=DIR],
[path for extra completions]),
[extra_completionsdir=$withval],
[extra_completionsdir='${datadir}/fish/vendor_completions.d'])
AC_SUBST(extra_functionsdir)
AC_ARG_WITH([extra_functionsdir],
AS_HELP_STRING([--with-extra-functionsdir=DIR],
[path for extra functions]),
[extra_functionsdir=$withval],
[extra_functionsdir='${datadir}/fish/vendor_functions.d'])
AC_SUBST(extra_confdir)
AC_ARG_WITH([extra-confdir],
AS_HELP_STRING([--with-extra-confdir=DIR],
[path for extra conf]),
[extra_confdir=$withval],
[extra_confdir='${datadir}/fish/vendor_conf.d'])
# Tell the world what we know.
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo "fish is now configured."

2
debian/control vendored
View File

@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 9.0.0), libncurses5-dev, cmake3 (>= 3.2.0) | cmake
# Test dependencies
locales-all
# When libpcre2-dev is available on all supported Debian versions, add a dependency on that.
Standards-Version: 3.9.4
Standards-Version: 3.9.7
Homepage: https://fishshell.com/
Vcs-Git: https://github.com/fish-shell/fish-shell.git
Vcs-Browser: https://github.com/fish-shell/fish-shell

12
fish.desktop Normal file
View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=true
# This file is for use in appimages, which rewrite the path.
# Other uses would have to replace these with the correct path.
Exec=fish
Name=fish
Icon=fish
# "Shell" would be the proper category, but it's reserved so we can't use it.
Categories=ConsoleOnly;System;

BIN
fish.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@@ -14,22 +14,21 @@ BuildRequires: ncurses-devel gettext gcc-c++ autoconf
%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: cmake3
%else
BuildRequires: cmake
BuildRequires: cmake pcre2-devel
%endif
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: gcc48 gcc48-c++
%endif
%if 0%{?is_opensuse} || 0%{?fedora}
BuildRequires: pcre2-devel
BuildRequires: gcc48 gcc48-c++ python-argparse
%endif
# for tests
%if 0%{?fedora}
%if 0%{?fedora} || 0%{?rhel} && 0%{?rhel} > 7
# Need the en_US.utf-8 locale at a minimum
BuildRequires: glibc-langpack-en
%endif
%if 0%{?rhel} && 0%{?rhel} > 7
BuildRequires: python3
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

View File

@@ -1,501 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -1,562 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the specified
# version of the C++ standard. If necessary, add switches to CXX and
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
# or '14' (for the C++14 standard).
#
# The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
# -std=c++11). If neither is specified, you get whatever works, with
# preference for an extended mode.
#
# The third argument, if specified 'mandatory' or if left unspecified,
# indicates that baseline support for the specified C++ standard is
# required and that the macro should error out if no mode with that
# support is found. If specified 'optional', then configuration proceeds
# regardless, after defining HAVE_CXX${VERSION} if and only if a
# supporting mode is found.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 4
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
m4_if([$1], [11], [],
[$1], [14], [],
[$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])],
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$2], [], [],
[$2], [ext], [],
[$2], [noext], [],
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
[$3], [optional], [ax_cxx_compile_cxx$1_required=false],
[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
AC_LANG_PUSH([C++])dnl
ac_success=no
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
ax_cv_cxx_compile_cxx$1,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[ax_cv_cxx_compile_cxx$1=yes],
[ax_cv_cxx_compile_cxx$1=no])])
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
ac_success=yes
fi
m4_if([$2], [noext], [], [dnl
if test x$ac_success = xno; then
for switch in -std=gnu++$1 -std=gnu++0x; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
done
fi])
m4_if([$2], [ext], [], [dnl
if test x$ac_success = xno; then
dnl HP's aCC needs +std=c++11 according to:
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
dnl Cray's crayCC needs "-h std=c++11"
for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
done
fi])
AC_LANG_POP([C++])
if test x$ax_cxx_compile_cxx$1_required = xtrue; then
if test x$ac_success = xno; then
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
fi
fi
if test x$ac_success = xno; then
HAVE_CXX$1=0
AC_MSG_NOTICE([No compiler with C++$1 support was found])
else
HAVE_CXX$1=1
AC_DEFINE(HAVE_CXX$1,1,
[define if the compiler supports basic C++$1 syntax])
fi
AC_SUBST(HAVE_CXX$1)
])
dnl Test body for checking C++11 support
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
)
dnl Test body for checking C++14 support
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
)
dnl Tests for new features in C++11
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
namespace cxx11
{
namespace test_static_assert
{
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
}
namespace test_final_override
{
struct Base
{
virtual void f() {}
};
struct Derived : public Base
{
virtual void f() override {}
};
}
namespace test_double_right_angle_brackets
{
template < typename T >
struct check {};
typedef check<void> single_type;
typedef check<check<void>> double_type;
typedef check<check<check<void>>> triple_type;
typedef check<check<check<check<void>>>> quadruple_type;
}
namespace test_decltype
{
int
f()
{
int a = 1;
decltype(a) b = 2;
return a + b;
}
}
namespace test_type_deduction
{
template < typename T1, typename T2 >
struct is_same
{
static const bool value = false;
};
template < typename T >
struct is_same<T, T>
{
static const bool value = true;
};
template < typename T1, typename T2 >
auto
add(T1 a1, T2 a2) -> decltype(a1 + a2)
{
return a1 + a2;
}
int
test(const int c, volatile int v)
{
static_assert(is_same<int, decltype(0)>::value == true, "");
static_assert(is_same<int, decltype(c)>::value == false, "");
static_assert(is_same<int, decltype(v)>::value == false, "");
auto ac = c;
auto av = v;
auto sumi = ac + av + 'x';
auto sumf = ac + av + 1.0;
static_assert(is_same<int, decltype(ac)>::value == true, "");
static_assert(is_same<int, decltype(av)>::value == true, "");
static_assert(is_same<int, decltype(sumi)>::value == true, "");
static_assert(is_same<int, decltype(sumf)>::value == false, "");
static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
return (sumf > 0.0) ? sumi : add(c, v);
}
}
namespace test_noexcept
{
int f() { return 0; }
int g() noexcept { return 0; }
static_assert(noexcept(f()) == false, "");
static_assert(noexcept(g()) == true, "");
}
namespace test_constexpr
{
template < typename CharT >
unsigned long constexpr
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
{
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
}
template < typename CharT >
unsigned long constexpr
strlen_c(const CharT *const s) noexcept
{
return strlen_c_r(s, 0UL);
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("1") == 1UL, "");
static_assert(strlen_c("example") == 7UL, "");
static_assert(strlen_c("another\0example") == 7UL, "");
}
namespace test_rvalue_references
{
template < int N >
struct answer
{
static constexpr int value = N;
};
answer<1> f(int&) { return answer<1>(); }
answer<2> f(const int&) { return answer<2>(); }
answer<3> f(int&&) { return answer<3>(); }
void
test()
{
int i = 0;
const int c = 0;
static_assert(decltype(f(i))::value == 1, "");
static_assert(decltype(f(c))::value == 2, "");
static_assert(decltype(f(0))::value == 3, "");
}
}
namespace test_uniform_initialization
{
struct test
{
static const int zero {};
static const int one {1};
};
static_assert(test::zero == 0, "");
static_assert(test::one == 1, "");
}
namespace test_lambdas
{
void
test1()
{
auto lambda1 = [](){};
auto lambda2 = lambda1;
lambda1();
lambda2();
}
int
test2()
{
auto a = [](int i, int j){ return i + j; }(1, 2);
auto b = []() -> int { return '0'; }();
auto c = [=](){ return a + b; }();
auto d = [&](){ return c; }();
auto e = [a, &b](int x) mutable {
const auto identity = [](int y){ return y; };
for (auto i = 0; i < a; ++i)
a += b--;
return x + identity(a + b);
}(0);
return a + b + c + d + e;
}
int
test3()
{
const auto nullary = [](){ return 0; };
const auto unary = [](int x){ return x; };
using nullary_t = decltype(nullary);
using unary_t = decltype(unary);
const auto higher1st = [](nullary_t f){ return f(); };
const auto higher2nd = [unary](nullary_t f1){
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
};
return higher1st(nullary) + higher2nd(nullary)(unary);
}
}
namespace test_variadic_templates
{
template <int...>
struct sum;
template <int N0, int... N1toN>
struct sum<N0, N1toN...>
{
static constexpr auto value = N0 + sum<N1toN...>::value;
};
template <>
struct sum<>
{
static constexpr auto value = 0;
};
static_assert(sum<>::value == 0, "");
static_assert(sum<1>::value == 1, "");
static_assert(sum<23>::value == 23, "");
static_assert(sum<1, 2>::value == 3, "");
static_assert(sum<5, 5, 11>::value == 21, "");
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
}
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
// because of this.
namespace test_template_alias_sfinae
{
struct foo {};
template<typename T>
using member = typename T::member_type;
template<typename T>
void func(...) {}
template<typename T>
void func(member<T>*) {}
void test();
void test() { func<foo>(0); }
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
]])
dnl Tests for new features in C++14
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
// If the compiler admits that it is not ready for C++14, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201402L
#error "This is not a C++14 compiler"
#else
namespace cxx14
{
namespace test_polymorphic_lambdas
{
int
test()
{
const auto lambda = [](auto&&... args){
const auto istiny = [](auto x){
return (sizeof(x) == 1UL) ? 1 : 0;
};
const int aretiny[] = { istiny(args)... };
return aretiny[0];
};
return lambda(1, 1L, 1.0f, '1');
}
}
namespace test_binary_literals
{
constexpr auto ivii = 0b0000000000101010;
static_assert(ivii == 42, "wrong value");
}
namespace test_generalized_constexpr
{
template < typename CharT >
constexpr unsigned long
strlen_c(const CharT *const s) noexcept
{
auto length = 0UL;
for (auto p = s; *p; ++p)
++length;
return length;
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("x") == 1UL, "");
static_assert(strlen_c("test") == 4UL, "");
static_assert(strlen_c("another\0test") == 7UL, "");
}
namespace test_lambda_init_capture
{
int
test()
{
auto x = 0;
const auto lambda1 = [a = x](int b){ return a + b; };
const auto lambda2 = [a = lambda1(x)](){ return a; };
return lambda2();
}
}
namespace test_digit_seperators
{
constexpr auto ten_million = 100'000'000;
static_assert(ten_million == 100000000, "");
}
namespace test_return_type_deduction
{
auto f(int& x) { return x; }
decltype(auto) g(int& x) { return x; }
template < typename T1, typename T2 >
struct is_same
{
static constexpr auto value = false;
};
template < typename T >
struct is_same<T, T>
{
static constexpr auto value = true;
};
int
test()
{
auto x = 0;
static_assert(is_same<int, decltype(f(x))>::value, "");
static_assert(is_same<int&, decltype(g(x))>::value, "");
return x;
}
}
} // namespace cxx14
#endif // __cplusplus >= 201402L
]])

View File

@@ -1,39 +0,0 @@
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
# ============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++11
# standard; if necessary, add switches to CXX and CXXCPP to enable
# support.
#
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
# macro with the version set to C++11. The two optional arguments are
# forwarded literally as the second and third argument respectively.
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
# more information. If you want to use this macro, you also need to
# download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 17
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])

View File

@@ -24,6 +24,8 @@
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>NSAppleEventsUsageDescription</key>
<string>A Terminal window with the fish shell running in it will be opened.</string>
<key>LSUIElement</key>
<true/>
<key>NSHumanReadableCopyright</key>

View File

@@ -4,8 +4,8 @@
set -e
# Make sure we're run as root
scriptname=`basename "$0"`
if [[ $UID -ne 0 ]]; then
scriptname=$(basename "$0")
if [ "$UID" -ne 0 ]; then
echo "${scriptname} must be run as root"
exit 1
fi

15614
po/de.po

File diff suppressed because it is too large Load Diff

13497
po/en.po

File diff suppressed because it is too large Load Diff

2180
po/fr.po

File diff suppressed because it is too large Load Diff

382
po/nb.po
View File

@@ -1543,13 +1543,10 @@ msgid "There are still jobs active:\n"
msgstr ""
#: src/reader.cpp:2161
#, fuzzy
msgid ""
"\n"
" PID Command\n"
msgstr ""
"\n"
" PID Command\n"
#: src/reader.cpp:2170
msgid "A second attempt to exit will terminate them.\n"
@@ -3272,9 +3269,8 @@ msgid "%s %s: Abbreviation %s cannot have spaces in the word\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr.fish:4
#, fuzzy
msgid "%s %s: Expected one argument\\n"
msgstr "%s %s: Expected one argument\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr.fish:6
#: /tmp/fish/explicit/share/functions/abbr.fish:10
@@ -3294,40 +3290,6 @@ msgstr ""
msgid "%s %s: Unexpected argument -- '%s'\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:1
msgid "%s: invalid option -- %s\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:2
msgid "%s: %s cannot be specified along with %s\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:3
msgid "%s: option requires an argument -- %s\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:4
msgid "%s: Unexpected argument -- %s\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:5
#: /tmp/fish/explicit/share/functions/abbr_old.fish:8
msgid "%s: abbreviation cannot have spaces in the key\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:6
msgid "%s: abbreviation must have a value\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:7
msgid "%s: abbreviation '%s' already exists, cannot rename\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:9
#: /tmp/fish/explicit/share/functions/abbr_old.fish:10
msgid "%s: no such abbreviation '%s'\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/alias.fish:1
msgid "%s: Name cannot be empty\\n"
msgstr ""
@@ -3377,14 +3339,6 @@ msgstr ""
msgid "or the file was empty"
msgstr ""
#: /tmp/fish/explicit/share/functions/__fish_complete_tar.fish:1
#: /tmp/fish/explicit/share/functions/__fish_complete_tar.fish:2
#: /tmp/fish/explicit/share/functions/__fish_complete_tar.fish:3
#: /tmp/fish/explicit/share/functions/__fish_complete_tar.fish:4
#: /tmp/fish/explicit/share/functions/__fish_complete_unrar.fish:1
msgid "%s\\tArchived file\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/__fish_complete_zfs_ro_properties.fish:3
msgid "Achieved compression ratio"
msgstr ""
@@ -4217,7 +4171,6 @@ msgstr ""
#: /tmp/fish/implicit/share/completions/echo.fish:5
#: /tmp/fish/implicit/share/completions/entr.fish:3
#: /tmp/fish/implicit/share/completions/env.fish:5
#: /tmp/fish/implicit/share/completions/eval.fish:1
#: /tmp/fish/implicit/share/completions/exec.fish:1
#: /tmp/fish/implicit/share/completions/exit.fish:1
#: /tmp/fish/implicit/share/completions/fg.fish:1
@@ -4799,7 +4752,6 @@ msgstr ""
#: /tmp/fish/implicit/share/completions/mkvextract.fish:2
#: /tmp/fish/implicit/share/completions/mocha.fish:1
#: /tmp/fish/implicit/share/completions/modinfo.fish:11
#: /tmp/fish/implicit/share/completions/netcat.fish:7
#: /tmp/fish/implicit/share/completions/netctl-auto.fish:1
#: /tmp/fish/implicit/share/completions/poweroff.fish:1
#: /tmp/fish/implicit/share/completions/terraform.fish:2
@@ -12594,82 +12546,6 @@ msgstr ""
msgid "Enhance or reduce the image contrast"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:1
msgid "Show output in a more script friendly format"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:2
msgid "Download [twice to fetch dependencies]"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:3
msgid "Show info for target [twice for more details]"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:4
msgid "Search for packages by maintainer"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:5
msgid "Search for packages by name"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:6
msgid "Check AUR packages for updates"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:7
msgid "Use colored output"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:8
msgid "Show debug output"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:9
msgid "Overwrite existing files when downloading"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:10
msgid "Print formatted"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:11
msgid "Display help and quit"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:12
msgid "Ignore a package upgrade"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:13
msgid "Ignore a binary repo when checking for updates"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:14
msgid "Specify a delimiter for list formatters"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:15
msgid "Output less"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:16
msgid "Download targets to DIR"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:17
msgid "Limit the number of threads created [10]"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:18
msgid "Curl timeout in seconds"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:19
msgid "Output more"
msgstr ""
#: /tmp/fish/implicit/share/completions/cowsay.fish:1
#: /tmp/fish/implicit/share/completions/cowthink.fish:1
msgid "Specify eye string"
@@ -42865,90 +42741,6 @@ msgstr ""
msgid "Exclude files that match any pattern in file"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:1
msgid "Remote hostname"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:2
msgid "Same as -e, but use /bin/sh"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:3
msgid "Program to execute after connection"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:4
msgid "Allow broadcasts"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:5
msgid "Source-routing hop points"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:6
msgid "Source-routing pointer"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:8
msgid "Delay interval for lines sent, ports scaned"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:9
msgid "Set keepalive option"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:10
msgid "Listen mode, acts as a server"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:11
msgid "Numeric-only IP addresses, no DNS"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:12
msgid "Hex dump of traffic"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:13
msgid "Local port number"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:14
msgid "Randomize local and remote ports"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:15
msgid "Quit after EOF on stdin and delay of secs"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:16
msgid "Local source address"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:17
msgid "Answer Telnet negotiation"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:18
msgid "UDP Mode"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:19
msgid "Verbose, use twice to be more verbose"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:20
msgid "Timeout for connects and final net reads"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:21
msgid "Set Type of Service"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:22
msgid "No I/O - used for scanning"
msgstr ""
#: /tmp/fish/implicit/share/completions/netctl-auto.fish:3
msgid "List all available profiles for automatic selection"
msgstr ""
@@ -48452,22 +48244,6 @@ msgstr ""
msgid "Show the full path for the given Ruby command"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc.d.fish:1
msgid "Filter started daemons"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc.d.fish:2
msgid "Filter stopped daemons"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc.d.fish:3
msgid "Filter auto started daemons"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc.d.fish:4
msgid "Filter manually started daemons"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc-service.fish:1
msgid "Tests if the service exists or not"
msgstr ""
@@ -61531,10 +61307,6 @@ msgstr ""
msgid "Manage abbreviations using new fish 3.0 scheme."
msgstr ""
#: /tmp/fish/implicit/share/functions/abbr_old.fish:1
msgid "Manage abbreviations using old fish 2.x scheme."
msgstr ""
#: /tmp/fish/implicit/share/functions/alias.fish:1
msgid "Creates a function wrapping a command"
msgstr ""
@@ -61565,10 +61337,6 @@ msgstr ""
msgid "Edit the command buffer in an external editor"
msgstr ""
#: /tmp/fish/implicit/share/functions/eval.fish:1
msgid "Evaluate parameters as a command"
msgstr ""
#: /tmp/fish/implicit/share/functions/_.fish:1
msgid "Alias for the gettext command"
msgstr ""
@@ -61585,14 +61353,6 @@ msgstr ""
msgid "Return 0 if the current token has an open single-quote"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_abook_formats.fish:1
msgid "Complete abook formats"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_ant_targets.fish:1
msgid "Print list of targets from build.xml and imported files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_atool_archive_contents.fish:1
msgid "List archive contents"
msgstr ""
@@ -61941,10 +61701,6 @@ msgstr ""
msgid "Complete by list of running processes"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_setxkbmap.fish:1
msgid "Complete setxkb options"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_ssh.fish:1
msgid "common completions for ssh commands"
msgstr ""
@@ -61985,25 +61741,10 @@ msgstr ""
msgid "Complete subcommand"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_subcommand_root.fish:1
msgid ""
"Run the __fish_complete_subcommand function using a PATH containing /sbin "
"and /usr/sbin"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_suffix.fish:1
msgid "Complete using files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1
msgid "Complete \"svn diff\" arguments"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_tar.fish:1
#: /tmp/fish/implicit/share/functions/__fish_complete_unrar.fish:1
msgid "Peek inside of archives and list all files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1
msgid "Print list host-names with user@"
msgstr ""
@@ -62012,10 +61753,6 @@ msgstr ""
msgid "Print a list of local users, with the real user name as a description"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_wvdial_peers.fish:1
msgid "Complete wvdial peers"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_zfs_mountpoint_properties.fish:1
msgid "Completes with ZFS mountpoint properties"
msgstr ""
@@ -62087,7 +61824,6 @@ msgid "Checks if a specific option has been given in the current commandline"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_crux_packages.fish:1
#: /tmp/fish/implicit/share/functions/__fish_prt_packages.fish:1
msgid "Obtain a list of installed packages"
msgstr ""
@@ -62115,57 +61851,47 @@ msgstr ""
msgid "Command used to find descriptions for commands"
msgstr ""
#: /tmp/fish/implicit/share/functions/fish_fallback_prompt.fish:1
msgid ""
"A simple fallback prompt without too much color or special characters for "
"linux VTs"
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:1
msgid "Helper function for fish_git_prompt"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_filter_ant_targets.fish:1
msgid "Display targets within an ant build.xml file"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:1
msgid "Helper function for __fish_git_prompt"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:2
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:2
msgid "Prompt function for Git"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:3
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:3
msgid ""
"__fish_git_prompt helper, tells whether or not the current branch has staged "
"fish_git_prompt helper, tells whether or not the current branch has staged "
"files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:4
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:4
msgid ""
"__fish_git_prompt helper, tells whether or not the current branch has "
"fish_git_prompt helper, tells whether or not the current branch has "
"tracked, modified files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:5
msgid "__fish_git_prompt helper, returns the current Git operation and branch"
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:5
msgid "fish_git_prompt helper, returns the current Git operation and branch"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:6
msgid "__fish_git_prompt helper, checks char variables"
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:6
msgid "fish_git_prompt helper, checks char variables"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:7
msgid "__fish_git_prompt helper, checks color variables"
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:7
msgid "fish_git_prompt helper, checks color variables"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:8
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:8
msgid "Event handler, repaints prompt when functionality changes"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:9
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:9
msgid "Event handler, repaints prompt when any color changes"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:10
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:10
msgid "Event handler, repaints prompt when any char changes"
msgstr ""
@@ -62239,30 +61965,14 @@ msgstr ""
msgid "Paginate the current command using the users default pager"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_ports_dirs.fish:1
msgid "Obtain a list of ports local collections"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_abook_emails.fish:1
msgid "Print email addresses (abook)"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_addresses.fish:1
msgid "Print a list of known network addresses"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_arch_daemons.fish:1
msgid "Print arch daemons"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_commands.fish:1
msgid "Print a list of documented fish commands"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_debian_services.fish:1
msgid "Prints services installed"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_encodings.fish:1
msgid "Complete using available character encodings"
msgstr ""
@@ -62271,12 +61981,6 @@ msgstr ""
msgid "Print a list of all known filesystem types"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_function_prototypes.fish:1
msgid ""
"Prints the names of all function prototypes found in the headers in the "
"current directory"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_groups.fish:1
msgid "Print a list of local groups"
msgstr ""
@@ -62301,10 +62005,6 @@ msgstr ""
msgid "Print lpr printers"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_lsblk_columns.fish:1
msgid "Print available lsblk columns"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_mounted.fish:1
msgid "Print mounted devices"
msgstr ""
@@ -62329,71 +62029,27 @@ msgstr ""
msgid "Print directories where desktop files are stored"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xdg_desktop_file_ids.fish:1
msgid "Print all available xdg desktop file IDs"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xdg_mimetypes.fish:1
msgid "Print XDG mime types"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xrandr_modes.fish:1
msgid "Print xrandr modes"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xrandr_outputs.fish:1
msgid "Print xrandr outputs"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xwindows.fish:1
msgid "Print X windows"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_zfs_bookmarks.fish:1
msgid "Lists ZFS bookmarks, if the feature is enabled"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_zfs_filesystems.fish:1
msgid "Lists ZFS filesystems"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_zfs_snapshots.fish:1
msgid "Lists ZFS snapshots"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_zfs_volumes.fish:1
msgid "Lists ZFS volumes"
msgstr ""
#: /tmp/fish/implicit/share/functions/fish_prompt.fish:1
msgid "Write out the prompt"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_prt_no_subcommand.fish:1
msgid "Test if prt-get has yet to be given the command"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_prt_ports.fish:1
msgid "Obtain a list of ports"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_prt_use_package.fish:1
msgid "Test if prt-get should have packages as potential completion"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_prt_use_port.fish:1
msgid "Test if prt-get should have ports as potential completion"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_pwd.fish:1
#: /tmp/fish/implicit/share/functions/__fish_pwd.fish:2
msgid "Show current path"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_sgrep.fish:1
msgid "Call grep without honoring GREP_OPTIONS settings"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_shared_key_bindings.fish:1
msgid "Bindings shared between emacs and vi mode"
msgstr ""
@@ -62414,10 +62070,6 @@ msgstr ""
msgid "Call systemctl with some options from the current commandline"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_test_arg.fish:1
msgid "Test if the token under the cursor matches the specified wildcard"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_toggle_comment_commandline.fish:1
msgid "Comment/uncomment the current command"
msgstr ""

381
po/nn.po
View File

@@ -1543,13 +1543,10 @@ msgid "There are still jobs active:\n"
msgstr ""
#: src/reader.cpp:2161
#, fuzzy
msgid ""
"\n"
" PID Command\n"
msgstr ""
"\n"
" PID Command\n"
#: src/reader.cpp:2170
msgid "A second attempt to exit will terminate them.\n"
@@ -3272,9 +3269,8 @@ msgid "%s %s: Abbreviation %s cannot have spaces in the word\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr.fish:4
#, fuzzy
msgid "%s %s: Expected one argument\\n"
msgstr "%s %s: Expected one argument\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr.fish:6
#: /tmp/fish/explicit/share/functions/abbr.fish:10
@@ -3294,40 +3290,6 @@ msgstr ""
msgid "%s %s: Unexpected argument -- '%s'\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:1
msgid "%s: invalid option -- %s\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:2
msgid "%s: %s cannot be specified along with %s\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:3
msgid "%s: option requires an argument -- %s\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:4
msgid "%s: Unexpected argument -- %s\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:5
#: /tmp/fish/explicit/share/functions/abbr_old.fish:8
msgid "%s: abbreviation cannot have spaces in the key\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:6
msgid "%s: abbreviation must have a value\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:7
msgid "%s: abbreviation '%s' already exists, cannot rename\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/abbr_old.fish:9
#: /tmp/fish/explicit/share/functions/abbr_old.fish:10
msgid "%s: no such abbreviation '%s'\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/alias.fish:1
msgid "%s: Name cannot be empty\\n"
msgstr ""
@@ -3377,14 +3339,6 @@ msgstr ""
msgid "or the file was empty"
msgstr ""
#: /tmp/fish/explicit/share/functions/__fish_complete_tar.fish:1
#: /tmp/fish/explicit/share/functions/__fish_complete_tar.fish:2
#: /tmp/fish/explicit/share/functions/__fish_complete_tar.fish:3
#: /tmp/fish/explicit/share/functions/__fish_complete_tar.fish:4
#: /tmp/fish/explicit/share/functions/__fish_complete_unrar.fish:1
msgid "%s\\tArchived file\\n"
msgstr ""
#: /tmp/fish/explicit/share/functions/__fish_complete_zfs_ro_properties.fish:3
msgid "Achieved compression ratio"
msgstr ""
@@ -4799,7 +4753,6 @@ msgstr ""
#: /tmp/fish/implicit/share/completions/mkvextract.fish:2
#: /tmp/fish/implicit/share/completions/mocha.fish:1
#: /tmp/fish/implicit/share/completions/modinfo.fish:11
#: /tmp/fish/implicit/share/completions/netcat.fish:7
#: /tmp/fish/implicit/share/completions/netctl-auto.fish:1
#: /tmp/fish/implicit/share/completions/poweroff.fish:1
#: /tmp/fish/implicit/share/completions/terraform.fish:2
@@ -12594,82 +12547,6 @@ msgstr ""
msgid "Enhance or reduce the image contrast"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:1
msgid "Show output in a more script friendly format"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:2
msgid "Download [twice to fetch dependencies]"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:3
msgid "Show info for target [twice for more details]"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:4
msgid "Search for packages by maintainer"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:5
msgid "Search for packages by name"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:6
msgid "Check AUR packages for updates"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:7
msgid "Use colored output"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:8
msgid "Show debug output"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:9
msgid "Overwrite existing files when downloading"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:10
msgid "Print formatted"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:11
msgid "Display help and quit"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:12
msgid "Ignore a package upgrade"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:13
msgid "Ignore a binary repo when checking for updates"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:14
msgid "Specify a delimiter for list formatters"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:15
msgid "Output less"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:16
msgid "Download targets to DIR"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:17
msgid "Limit the number of threads created [10]"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:18
msgid "Curl timeout in seconds"
msgstr ""
#: /tmp/fish/implicit/share/completions/cower.fish:19
msgid "Output more"
msgstr ""
#: /tmp/fish/implicit/share/completions/cowsay.fish:1
#: /tmp/fish/implicit/share/completions/cowthink.fish:1
msgid "Specify eye string"
@@ -42865,90 +42742,6 @@ msgstr ""
msgid "Exclude files that match any pattern in file"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:1
msgid "Remote hostname"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:2
msgid "Same as -e, but use /bin/sh"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:3
msgid "Program to execute after connection"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:4
msgid "Allow broadcasts"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:5
msgid "Source-routing hop points"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:6
msgid "Source-routing pointer"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:8
msgid "Delay interval for lines sent, ports scaned"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:9
msgid "Set keepalive option"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:10
msgid "Listen mode, acts as a server"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:11
msgid "Numeric-only IP addresses, no DNS"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:12
msgid "Hex dump of traffic"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:13
msgid "Local port number"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:14
msgid "Randomize local and remote ports"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:15
msgid "Quit after EOF on stdin and delay of secs"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:16
msgid "Local source address"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:17
msgid "Answer Telnet negotiation"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:18
msgid "UDP Mode"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:19
msgid "Verbose, use twice to be more verbose"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:20
msgid "Timeout for connects and final net reads"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:21
msgid "Set Type of Service"
msgstr ""
#: /tmp/fish/implicit/share/completions/netcat.fish:22
msgid "No I/O - used for scanning"
msgstr ""
#: /tmp/fish/implicit/share/completions/netctl-auto.fish:3
msgid "List all available profiles for automatic selection"
msgstr ""
@@ -48452,22 +48245,6 @@ msgstr ""
msgid "Show the full path for the given Ruby command"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc.d.fish:1
msgid "Filter started daemons"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc.d.fish:2
msgid "Filter stopped daemons"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc.d.fish:3
msgid "Filter auto started daemons"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc.d.fish:4
msgid "Filter manually started daemons"
msgstr ""
#: /tmp/fish/implicit/share/completions/rc-service.fish:1
msgid "Tests if the service exists or not"
msgstr ""
@@ -61531,10 +61308,6 @@ msgstr ""
msgid "Manage abbreviations using new fish 3.0 scheme."
msgstr ""
#: /tmp/fish/implicit/share/functions/abbr_old.fish:1
msgid "Manage abbreviations using old fish 2.x scheme."
msgstr ""
#: /tmp/fish/implicit/share/functions/alias.fish:1
msgid "Creates a function wrapping a command"
msgstr ""
@@ -61565,10 +61338,6 @@ msgstr ""
msgid "Edit the command buffer in an external editor"
msgstr ""
#: /tmp/fish/implicit/share/functions/eval.fish:1
msgid "Evaluate parameters as a command"
msgstr ""
#: /tmp/fish/implicit/share/functions/_.fish:1
msgid "Alias for the gettext command"
msgstr ""
@@ -61585,14 +61354,6 @@ msgstr ""
msgid "Return 0 if the current token has an open single-quote"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_abook_formats.fish:1
msgid "Complete abook formats"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_ant_targets.fish:1
msgid "Print list of targets from build.xml and imported files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_atool_archive_contents.fish:1
msgid "List archive contents"
msgstr ""
@@ -61941,10 +61702,6 @@ msgstr ""
msgid "Complete by list of running processes"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_setxkbmap.fish:1
msgid "Complete setxkb options"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_ssh.fish:1
msgid "common completions for ssh commands"
msgstr ""
@@ -61985,25 +61742,10 @@ msgstr ""
msgid "Complete subcommand"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_subcommand_root.fish:1
msgid ""
"Run the __fish_complete_subcommand function using a PATH containing /sbin "
"and /usr/sbin"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_suffix.fish:1
msgid "Complete using files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1
msgid "Complete \"svn diff\" arguments"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_tar.fish:1
#: /tmp/fish/implicit/share/functions/__fish_complete_unrar.fish:1
msgid "Peek inside of archives and list all files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1
msgid "Print list host-names with user@"
msgstr ""
@@ -62012,10 +61754,6 @@ msgstr ""
msgid "Print a list of local users, with the real user name as a description"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_wvdial_peers.fish:1
msgid "Complete wvdial peers"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_complete_zfs_mountpoint_properties.fish:1
msgid "Completes with ZFS mountpoint properties"
msgstr ""
@@ -62087,7 +61825,6 @@ msgid "Checks if a specific option has been given in the current commandline"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_crux_packages.fish:1
#: /tmp/fish/implicit/share/functions/__fish_prt_packages.fish:1
msgid "Obtain a list of installed packages"
msgstr ""
@@ -62115,57 +61852,47 @@ msgstr ""
msgid "Command used to find descriptions for commands"
msgstr ""
#: /tmp/fish/implicit/share/functions/fish_fallback_prompt.fish:1
msgid ""
"A simple fallback prompt without too much color or special characters for "
"linux VTs"
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:1
msgid "Helper function for fish_git_prompt"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_filter_ant_targets.fish:1
msgid "Display targets within an ant build.xml file"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:1
msgid "Helper function for __fish_git_prompt"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:2
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:2
msgid "Prompt function for Git"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:3
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:3
msgid ""
"__fish_git_prompt helper, tells whether or not the current branch has staged "
"fish_git_prompt helper, tells whether or not the current branch has staged "
"files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:4
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:4
msgid ""
"__fish_git_prompt helper, tells whether or not the current branch has "
"fish_git_prompt helper, tells whether or not the current branch has "
"tracked, modified files"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:5
msgid "__fish_git_prompt helper, returns the current Git operation and branch"
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:5
msgid "fish_git_prompt helper, returns the current Git operation and branch"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:6
msgid "__fish_git_prompt helper, checks char variables"
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:6
msgid "fish_git_prompt helper, checks char variables"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:7
msgid "__fish_git_prompt helper, checks color variables"
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:7
msgid "fish_git_prompt helper, checks color variables"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:8
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:8
msgid "Event handler, repaints prompt when functionality changes"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:9
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:9
msgid "Event handler, repaints prompt when any color changes"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_git_prompt.fish:10
#: /tmp/fish/implicit/share/functions/fish_git_prompt.fish:10
msgid "Event handler, repaints prompt when any char changes"
msgstr ""
@@ -62239,30 +61966,14 @@ msgstr ""
msgid "Paginate the current command using the users default pager"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_ports_dirs.fish:1
msgid "Obtain a list of ports local collections"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_abook_emails.fish:1
msgid "Print email addresses (abook)"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_addresses.fish:1
msgid "Print a list of known network addresses"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_arch_daemons.fish:1
msgid "Print arch daemons"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_commands.fish:1
msgid "Print a list of documented fish commands"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_debian_services.fish:1
msgid "Prints services installed"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_encodings.fish:1
msgid "Complete using available character encodings"
msgstr ""
@@ -62271,12 +61982,6 @@ msgstr ""
msgid "Print a list of all known filesystem types"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_function_prototypes.fish:1
msgid ""
"Prints the names of all function prototypes found in the headers in the "
"current directory"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_groups.fish:1
msgid "Print a list of local groups"
msgstr ""
@@ -62301,10 +62006,6 @@ msgstr ""
msgid "Print lpr printers"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_lsblk_columns.fish:1
msgid "Print available lsblk columns"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_mounted.fish:1
msgid "Print mounted devices"
msgstr ""
@@ -62329,71 +62030,27 @@ msgstr ""
msgid "Print directories where desktop files are stored"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xdg_desktop_file_ids.fish:1
msgid "Print all available xdg desktop file IDs"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xdg_mimetypes.fish:1
msgid "Print XDG mime types"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xrandr_modes.fish:1
msgid "Print xrandr modes"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xrandr_outputs.fish:1
msgid "Print xrandr outputs"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_xwindows.fish:1
msgid "Print X windows"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_zfs_bookmarks.fish:1
msgid "Lists ZFS bookmarks, if the feature is enabled"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_zfs_filesystems.fish:1
msgid "Lists ZFS filesystems"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_zfs_snapshots.fish:1
msgid "Lists ZFS snapshots"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_print_zfs_volumes.fish:1
msgid "Lists ZFS volumes"
msgstr ""
#: /tmp/fish/implicit/share/functions/fish_prompt.fish:1
msgid "Write out the prompt"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_prt_no_subcommand.fish:1
msgid "Test if prt-get has yet to be given the command"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_prt_ports.fish:1
msgid "Obtain a list of ports"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_prt_use_package.fish:1
msgid "Test if prt-get should have packages as potential completion"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_prt_use_port.fish:1
msgid "Test if prt-get should have ports as potential completion"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_pwd.fish:1
#: /tmp/fish/implicit/share/functions/__fish_pwd.fish:2
msgid "Show current path"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_sgrep.fish:1
msgid "Call grep without honoring GREP_OPTIONS settings"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_shared_key_bindings.fish:1
msgid "Bindings shared between emacs and vi mode"
msgstr ""
@@ -62414,10 +62071,6 @@ msgstr ""
msgid "Call systemctl with some options from the current commandline"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_test_arg.fish:1
msgid "Test if the token under the cursor matches the specified wildcard"
msgstr ""
#: /tmp/fish/implicit/share/functions/__fish_toggle_comment_commandline.fish:1
msgid "Comment/uncomment the current command"
msgstr ""

2228
po/pl.po

File diff suppressed because it is too large Load Diff

17142
po/pt_BR.po

File diff suppressed because it is too large Load Diff

16242
po/sv.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@ complete -c VBoxHeadless -l vrdeproperty -o vrdeproperty -s e -x -d "Set VRDE pr
complete -c VBoxHeadless -l settingspw -x -d "Specify settings password"
complete -c VBoxHeadless -l settingspwfile -f -d "Specify file containing setting password"
complete -c VBoxHeadless -l start-paused -o start-paused -d "Start VM in paused state"
complete -c VBoxHeadless -l capture -o capture -s c -x -d "Record VM screen ouput to file"
complete -c VBoxHeadless -l capture -o capture -s c -x -d "Record VM screen output to file"
complete -c VBoxHeadless -l width -s w -x -d "Frame width when recording"
complete -c VBoxHeadless -l height -s h -x -d "Frame height when recording"
complete -c VBoxHeadless -l bitrate -s r -x -d "Recording bit rate when recording"

View File

@@ -1,7 +1,7 @@
complete -c abbr -f -s a -l add -d 'Add abbreviation'
# Abbr keys can't contain spaces, so we can safely replace the first space with a tab
# `abbr -s` won't work here because that already escapes
complete -c abbr -s e -l erase -d 'Erase abbreviation' -xa '(string replace " " \t -- $fish_user_abbreviations)'
complete -c abbr -s e -l erase -d 'Erase abbreviation' -xa '(abbr --list)'
complete -c abbr -f -s s -l show -d 'Print all abbreviations'
complete -c abbr -f -s l -l list -d 'Print all abbreviation names'
complete -c abbr -f -s h -l help -d 'Help'

View File

@@ -1,16 +1,29 @@
function __fish_complete_abook_formats --description 'Complete abook formats'
set -l pat
switch $argv[1]
case in
set pat '/output:/,$d; /input:\|^$/d'
case out
set pat '/input:/,/output:/d; /^$/d'
case '*'
return 1
end
abook --formats | sed -e $pat -e 's/^\s\+//'
end
complete -c abook -s h -d 'Show usage'
complete -c abook -s C -l config -d 'Use an alternative configuration file' -r
complete -c abook -l datafile -d 'Use an alternative addressbook file' -r
complete -c abook -l mutt-query -d 'Make a query for mutt' -x
complete -c abook -l add-email -d 'Read email message from stdin and add the sender'
complete -c abook -l add-email-quiet -d 'Same as --add-email. Without confirmation'
complete -c abook -l convert -d 'Convert address book files'
complete -c abook -l datafile -d 'Use an alternative addressbook file' -r
complete -c abook -l mutt-query -d 'Make a query for mutt' -x
complete -c abook -l add-email -d 'Read email message from stdin and add the sender'
complete -c abook -l add-email-quiet -d 'Same as --add-email. Without confirmation'
complete -c abook -l convert -d 'Convert address book files'
set -l convert 'contains -- --convert (commandline -po)'
complete -c abook -l informat -d 'Input file format' -xa '(__fish_complete_abook_formats in)' -n $convert
complete -c abook -l outformat -d 'Output file format' -xa '(__fish_complete_abook_formats out)' -n $convert
complete -c abook -l infile -d 'Input file (default: stdin)' -r -n $convert
complete -c abook -l outfile -d 'Output file (default: stdout)' -r -n $convert
complete -c abook -l informat -d 'Input file format' -xa '(__fish_complete_abook_formats in)' -n $convert
complete -c abook -l outformat -d 'Output file format' -xa '(__fish_complete_abook_formats out)' -n $convert
complete -c abook -l infile -d 'Input file (default: stdin)' -r -n $convert
complete -c abook -l outfile -d 'Output file (default: stdout)' -r -n $convert
complete -c abook -l formats -d 'Print available formats'
complete -c abook -l formats -d 'Print available formats'

View File

@@ -83,9 +83,9 @@ complete -c ack -l thpppt -d 'Bill the Cat'
complete -c ack -l bar -d 'The warning admiral'
# File types
if type ack > /dev/null
for type in (ack --dump 2>/dev/null | perl -lne 'print $1 if /^\s+--type-add=([^:]+)/' | uniq)
complete -c ack -l $type -d "Allow $type file type"
complete -c ack -l no$type -l no-$type -d "Don't allow $type file type"
end
if type ack >/dev/null
for type in (ack --dump 2>/dev/null | perl -lne 'print $1 if /^\s+--type-add=([^:]+)/' | uniq)
complete -c ack -l $type -d "Allow $type file type"
complete -c ack -l no$type -l no-$type -d "Don't allow $type file type"
end
end

View File

@@ -14,7 +14,7 @@ complete -c acpi -s A -l without-ac-adapter -d 'Suppress ac-adapter information'
complete -c acpi -s V -l everything -d 'Show every device, overrides above options'
complete -c acpi -s s -l show-empty -d 'Show non-operational devices'
complete -c acpi -s S -l hide-empty -d 'Hide non-operational devices'
complete -c acpi -s c -l celcius -d 'Use celcius as the temperature unit'
complete -c acpi -s c -l celcius -d 'Use celsius as the temperature unit'
complete -c acpi -s f -l fahrenheit -d 'Use fahrenheit as the temperature unit'
complete -c acpi -s k -l kelvin -d 'Use kelvin as the temperature unit'
complete -c acpi -s d -l directory -d '<dir> path to ACPI info (/proc/acpi)'

View File

@@ -59,17 +59,17 @@ function __fish_adb_list_uninstallable_packages
end
function __fish_adb_list_files
set -l token (commandline -ct)
set -l token (commandline -ct)
# Have tab complete show initial / if nothing on current token
if test -z "$token"
set token "/"
end
# Have tab complete show initial / if nothing on current token
if test -z "$token"
set token "/"
end
# Return list of directories suffixed with '/'
__fish_adb_run_command find -H "$token*" -maxdepth 0 -type d 2>/dev/null | awk '{print $1"/"}'
# Return list of files
__fish_adb_run_command find -H "$token*" -maxdepth 0 -type f 2>/dev/null
# Return list of directories suffixed with '/'
__fish_adb_run_command find -H "$token*" -maxdepth 0 -type d 2>/dev/null | awk '{print $1"/"}'
# Return list of files
__fish_adb_run_command find -H "$token*" -maxdepth 0 -type f 2>/dev/null
end

View File

@@ -2,13 +2,13 @@ set -l cmds 'scontrols scontents controls contents sget sset cset cget set get'
complete -c amixer -xa "$cmds" -n "not __fish_seen_subcommand_from $cmds"
complete -c amixer -n '__fish_seen_subcommand_from sset sget get set' -xa "(amixer scontrols | cut --delimiter \' --fields 2)"
complete -c amixer -s h -l help -d 'this help'
complete -c amixer -s c -l card -r -d 'select the card'
complete -c amixer -s D -l device -r -d 'select the device, default \'default\''
complete -c amixer -s d -l debug -d 'debug mode'
complete -c amixer -s n -l nocheck -d 'do not perform range checking'
complete -c amixer -s v -l version -d 'print version of this program'
complete -c amixer -s q -l quiet -d 'be quiet'
complete -c amixer -s i -l inactive -d 'show also inactive controls'
complete -c amixer -s a -l abstract -d 'select abstraction level' -xa 'none basic'
complete -c amixer -s s -l stdin -d 'Read and execute commands from stdin sequentially'
complete -c amixer -s h -l help -d 'this help'
complete -c amixer -s c -l card -r -d 'select the card'
complete -c amixer -s D -l device -r -d 'select the device, default \'default\''
complete -c amixer -s d -l debug -d 'debug mode'
complete -c amixer -s n -l nocheck -d 'do not perform range checking'
complete -c amixer -s v -l version -d 'print version of this program'
complete -c amixer -s q -l quiet -d 'be quiet'
complete -c amixer -s i -l inactive -d 'show also inactive controls'
complete -c amixer -s a -l abstract -d 'select abstraction level' -xa 'none basic'
complete -c amixer -s s -l stdin -d 'Read and execute commands from stdin sequentially'

View File

@@ -1,3 +1,3 @@
complete -c and -s h -l help -d 'Display help and exit'
complete -c and -xa '( __fish_complete_subcommand )'
complete -c and -xa '(__fish_complete_subcommand --allow-functions-and-builtins)'

View File

@@ -1,65 +1,65 @@
complete -c animate -o alpha -d 'On, activate, off, deactivate, set, opaque, copy transparent, extract, background, or shape [option]' -xa '(animate -list alpha)'
complete -c animate -o authenticate -d 'Decipher image with this password [password]'
complete -c animate -o backdrop -d 'Display image centered on a backdrop'
complete -c animate -o channel -d 'Apply option to select image channels [type]' -xa '(animate -list channel)'
complete -c animate -o colormap -d 'Shared or Private [type]' -x
complete -c animate -o colorspace -d 'Alternate image colorspace [type]' -xa '(animate -list colorspace)'
complete -c animate -o decipher -d 'Convert cipher pixels to plain pixels [filename]' -r
complete -c animate -o define -d 'Define one or more image format options [format:option]'
complete -c animate -o delay -d 'Display the next image after pausing [value]'
complete -c animate -o density -d 'Horizontal and vertical density of the image [geometry]'
complete -c animate -o depth -d 'Image depth [value]'
complete -c animate -o display -d 'Display image to this X server [server]'
complete -c animate -o dispose -d 'Layer disposal method [method]' -xa '(animate -list dispose)'
complete -c animate -o dither -d 'Apply error diffusion to image [method]' -xa '(animate -list dither)'
complete -c animate -o filter -d 'Use this filter when resizing an image [type]' -xa '(animate -list filter)'
complete -c animate -o format -d 'Output formatted image characteristics ["string"]'
complete -c animate -o gamma -d 'Level of gamma correction [value]'
complete -c animate -o geometry -d 'Preferred size and location of the Image window [geometry]'
complete -c animate -o gravity -d 'Horizontal and vertical backdrop placement [type]' -xa '(animate -list gravity)'
complete -c animate -o identify -d 'Identify the format and characteristics of the image'
complete -c animate -o immutable -d 'Displayed image cannot be modified'
complete -c animate -o interlace -d 'Type of image interlacing scheme [type]' -xa '(animate -list interlace)'
complete -c animate -o interpolate -d 'Pixel color interpolation method [method]' -xa '(animate -list interpolate)'
complete -c animate -o limit -d 'Pixel cache resource limit [type value]' -x
complete -c animate -o loop -d 'Loop images then exit [iterations]'
complete -c animate -o map -d 'Display image using this Standard Colormap [type]' -x
complete -c animate -o monitor -d 'Monitor progress '
complete -c animate -o pause -d 'Seconds to pause before reanimating'
complete -c animate -o page -d 'Size and location of an image canvas (setting) [geometry]'
complete -c animate -o quantize -d 'Reduce colors in this colorspace [colorspace]' -xa '(animate -list colorspace)'
complete -c animate -o quiet -d 'Suppress all warning messages'
complete -c animate -o regard-warnings -d 'Pay attention to warning messages'
complete -c animate -o remote -d 'Command execute a command in an remote display process'
complete -c animate -o respect-parentheses -d 'Settings remain in effect until parenthesis boundary'
complete -c animate -o sampling-factor -d 'Horizontal and vertical sampling factor [geometry]'
complete -c animate -o seed -d 'Seed a new sequence of pseudo-random numbers [value]'
complete -c animate -o set -d 'Attribute set an image attribute [ value]'
complete -c animate -o size -d 'Width and height of image [geometry]'
complete -c animate -o transparent-color -d 'Transparent color [color]' -xa '(__fish_complete_convert_options color)'
complete -c animate -o treedepth -d 'Color tree depth [value]'
complete -c animate -o verbose -d 'Print detailed information about the image'
complete -c animate -o visual -d 'Display image using this visual type [type]' -x
complete -c animate -o virtual-pixel -d 'Virtual pixel access method [method]' -xa '(animate -list virtual-pixel)'
complete -c animate -o window -d 'Display image to background of this window [id]' -xa 'root (__fish_print_xwindows)'
complete -c animate -o colors -d 'Preferred number of colors in the image [value]'
complete -c animate -o crop -d 'Preferred size and location of the cropped image [geometry]'
complete -c animate -o extract -d 'Extract area from image [geometry]'
complete -c animate -o monochrome -d 'Transform image to black and white'
complete -c animate -o repage -d 'Size and location of an image canvas (operator) [geometry]'
complete -c animate -o resample -d 'Change the resolution of an image [geometry]'
complete -c animate -o resize -d 'Resize the image [geometry]'
complete -c animate -o rotate -d 'Apply Paeth rotation to the image [degrees]'
complete -c animate -o strip -d 'Strip image of all profiles and comments'
complete -c animate -o thumbnail -d 'Create a thumbnail of the image [geometry]'
complete -c animate -o trim -d 'Trim image edges'
complete -c animate -o coalesce -d 'Merge a sequence of images'
complete -c animate -o flatten -d 'Flatten a sequence of images'
complete -c animate -o debug -d 'Display copious debugging information [events]' -xa '(animate -list debug)'
complete -c animate -o help -d 'Print program options'
complete -c animate -o list -d 'Print a list of supported option arguments [type]' -xa '(animate -list list)'
complete -c animate -o log -d 'Format of debugging information [format]' -xa '(__fish_complete_convert_options format)'
complete -c animate -o version -d 'Print version information Press any button to map or unmap the Command widget'
complete -c animate -o matte -d 'Store matte channel if the image has one'
complete -c animate -o scenes -d 'Range image scene range'
complete -c animate -o support -d 'Resize support: > 1.0 is blurry, < 1.0 is sharp [factor]'
complete -c animate -o alpha -d 'On, activate, off, deactivate, set, opaque, copy transparent, extract, background, or shape [option]' -xa '(animate -list alpha)'
complete -c animate -o authenticate -d 'Decipher image with this password [password]'
complete -c animate -o backdrop -d 'Display image centered on a backdrop'
complete -c animate -o channel -d 'Apply option to select image channels [type]' -xa '(animate -list channel)'
complete -c animate -o colormap -d 'Shared or Private [type]' -x
complete -c animate -o colorspace -d 'Alternate image colorspace [type]' -xa '(animate -list colorspace)'
complete -c animate -o decipher -d 'Convert cipher pixels to plain pixels [filename]' -r
complete -c animate -o define -d 'Define one or more image format options [format:option]'
complete -c animate -o delay -d 'Display the next image after pausing [value]'
complete -c animate -o density -d 'Horizontal and vertical density of the image [geometry]'
complete -c animate -o depth -d 'Image depth [value]'
complete -c animate -o display -d 'Display image to this X server [server]'
complete -c animate -o dispose -d 'Layer disposal method [method]' -xa '(animate -list dispose)'
complete -c animate -o dither -d 'Apply error diffusion to image [method]' -xa '(animate -list dither)'
complete -c animate -o filter -d 'Use this filter when resizing an image [type]' -xa '(animate -list filter)'
complete -c animate -o format -d 'Output formatted image characteristics ["string"]'
complete -c animate -o gamma -d 'Level of gamma correction [value]'
complete -c animate -o geometry -d 'Preferred size and location of the Image window [geometry]'
complete -c animate -o gravity -d 'Horizontal and vertical backdrop placement [type]' -xa '(animate -list gravity)'
complete -c animate -o identify -d 'Identify the format and characteristics of the image'
complete -c animate -o immutable -d 'Displayed image cannot be modified'
complete -c animate -o interlace -d 'Type of image interlacing scheme [type]' -xa '(animate -list interlace)'
complete -c animate -o interpolate -d 'Pixel color interpolation method [method]' -xa '(animate -list interpolate)'
complete -c animate -o limit -d 'Pixel cache resource limit [type value]' -x
complete -c animate -o loop -d 'Loop images then exit [iterations]'
complete -c animate -o map -d 'Display image using this Standard Colormap [type]' -x
complete -c animate -o monitor -d 'Monitor progress '
complete -c animate -o pause -d 'Seconds to pause before reanimating'
complete -c animate -o page -d 'Size and location of an image canvas (setting) [geometry]'
complete -c animate -o quantize -d 'Reduce colors in this colorspace [colorspace]' -xa '(animate -list colorspace)'
complete -c animate -o quiet -d 'Suppress all warning messages'
complete -c animate -o regard-warnings -d 'Pay attention to warning messages'
complete -c animate -o remote -d 'Command execute a command in an remote display process'
complete -c animate -o respect-parentheses -d 'Settings remain in effect until parenthesis boundary'
complete -c animate -o sampling-factor -d 'Horizontal and vertical sampling factor [geometry]'
complete -c animate -o seed -d 'Seed a new sequence of pseudo-random numbers [value]'
complete -c animate -o set -d 'Attribute set an image attribute [ value]'
complete -c animate -o size -d 'Width and height of image [geometry]'
complete -c animate -o transparent-color -d 'Transparent color [color]' -xa '(__fish_complete_convert_options color)'
complete -c animate -o treedepth -d 'Color tree depth [value]'
complete -c animate -o verbose -d 'Print detailed information about the image'
complete -c animate -o visual -d 'Display image using this visual type [type]' -x
complete -c animate -o virtual-pixel -d 'Virtual pixel access method [method]' -xa '(animate -list virtual-pixel)'
complete -c animate -o window -d 'Display image to background of this window [id]' -xa 'root (__fish_print_xwindows)'
complete -c animate -o colors -d 'Preferred number of colors in the image [value]'
complete -c animate -o crop -d 'Preferred size and location of the cropped image [geometry]'
complete -c animate -o extract -d 'Extract area from image [geometry]'
complete -c animate -o monochrome -d 'Transform image to black and white'
complete -c animate -o repage -d 'Size and location of an image canvas (operator) [geometry]'
complete -c animate -o resample -d 'Change the resolution of an image [geometry]'
complete -c animate -o resize -d 'Resize the image [geometry]'
complete -c animate -o rotate -d 'Apply Paeth rotation to the image [degrees]'
complete -c animate -o strip -d 'Strip image of all profiles and comments'
complete -c animate -o thumbnail -d 'Create a thumbnail of the image [geometry]'
complete -c animate -o trim -d 'Trim image edges'
complete -c animate -o coalesce -d 'Merge a sequence of images'
complete -c animate -o flatten -d 'Flatten a sequence of images'
complete -c animate -o debug -d 'Display copious debugging information [events]' -xa '(animate -list debug)'
complete -c animate -o help -d 'Print program options'
complete -c animate -o list -d 'Print a list of supported option arguments [type]' -xa '(animate -list list)'
complete -c animate -o log -d 'Format of debugging information [format]' -xa '(__fish_complete_convert_options format)'
complete -c animate -o version -d 'Print version information Press any button to map or unmap the Command widget'
complete -c animate -o matte -d 'Store matte channel if the image has one'
complete -c animate -o scenes -d 'Range image scene range'
complete -c animate -o support -d 'Resize support: > 1.0 is blurry, < 1.0 is sharp [factor]'

View File

@@ -1,7 +1,40 @@
complete -c ansible-vault -l ask-vault-pass -f -d "Ask for vault password"
complete -c ansible-vault -s h -l help -f -d "Show this help message and exit"
complete -c ansible-vault -l new-vault-password-file -r -d "New vault password file for rekey"
complete -c ansible-vault -l output -r -d "Output file name for encrypt or decrypt; use - for stdout"
complete -c ansible-vault -l vault-password-file -r -d "Vault password file"
complete -c ansible-vault -s v -l verbose -d "Verbose mode (-vvv for more, -vvvv to enable connection debugging)"
function __fish_ansible_vault_no_subcommand -d 'Test if ansible-vault has yet to be given the subcommand'
commandline -pc | not string match --regex '[^-]\b(?:create|decrypt|edit|encrypt|encrypt_string|rekey|view)\b'
end
function __fish_ansible_vault_using_command
set -l cmd (string trim (__fish_ansible_vault_no_subcommand))
test -z "$cmd"
and return 1
contains -- "$cmd" $argv
end
# generic options
complete -c ansible-vault -l version -d "Display version and exit"
complete -c ansible-vault -s h -l help -f -d "Show help message and exit"
complete -c ansible-vault -s v -l verbose -d "Verbose mode (-vvv for more, -vvvv to enable connection debugging)"
complete -c ansible-vault -l ask-vault-pass -f -d "Ask for vault password"
complete -c ansible-vault -l new-vault-id -r -d "the new vault identity to use for rekey"
complete -c ansible-vault -l new-vault-password-file -r -d "New vault password file for rekey"
complete -c ansible-vault -l vault-id -r -d "the vault identity to use"
complete -c ansible-vault -l vault-password-file -r -d "Vault password file"
# subcommands
complete -c ansible-vault -n '__fish_ansible_vault_no_subcommand' -a decrypt -d 'Decrypt encrypted file or stdin'
complete -c ansible-vault -n '__fish_ansible_vault_no_subcommand' -a encrypt -d 'Encrypt a file or stdin'
complete -c ansible-vault -n '__fish_ansible_vault_no_subcommand' -ra create -d 'Create encrypted file'
complete -c ansible-vault -n '__fish_ansible_vault_no_subcommand' -ra edit -d 'Edit encrypted file'
complete -c ansible-vault -n '__fish_ansible_vault_no_subcommand' -ra rekey -d 'Rekey encrypted file'
complete -c ansible-vault -n '__fish_ansible_vault_no_subcommand' -ra view -d 'View contents of something encrypted'
complete -f -c ansible-vault -n '__fish_ansible_vault_no_subcommand' -a encrypt_string -d 'Encrypt string'
# encrypt_string options
complete -c ansible-vault -n '__fish_ansible_vault_using_command encrypt encrypt_string' -r -l stdin-name -f -d 'Specify the variable name for stdin'
complete -c ansible-vault -n '__fish_ansible_vault_using_command encrypt encrypt_string' -r -s n -l name -f -d 'Specify the variable name'
complete -c ansible-vault -n '__fish_ansible_vault_using_command encrypt encrypt_string' -s p -l prompt -d 'Prompt for the string to encrypt'
# shared options
complete -c ansible-vault -n '__fish_ansible_vault_using_command encrypt encrypt_string rekey edit create' -l encrypt-vault-id -r -d "the vault id used to encrypt (required if more than vault-id is provided)"
complete -c ansible-vault -n '__fish_ansible_vault_using_command encrypt encrypt_string decrypt' -l output -r -d "Output file name for encrypt or decrypt; use - for stdout"

View File

@@ -1,7 +1,63 @@
# Apache Ant (1.9.5) completion for Fish Shell.
function __fish_complete_ant_targets -d "Print list of targets from build.xml and imported files"
function __get_buildfile -d "Get a buildfile that will be used by ant"
set -l tokens $argv # tokens from 'commandline -co'
set -l prev $tokens[1]
set -l buildfile "build.xml"
for token in $argv[2..-1]
switch $prev
case -buildfile -file -f
set buildfile (eval echo $token)
end
set prev $token
end
# return last one
echo $buildfile
end
function __parse_ant_targets_from_projecthelp -d "Parse ant targets from projecthelp"
set -l buildfile $argv[1] # full path to buildfile
set -l targets (ant -p -debug -f $buildfile 2> /dev/null | string match -r '^\s[[:graph:]].*$')
for target in $targets
# Use [[:graph:]] and [[:print:]] to ignore ANSI escape code
set -l tokens (string match -r '^\s([[:graph:]]+)(?:\s+([[:print:]]+))?' "$target")
if [ (count $tokens) -ge 3 ]
echo $tokens[2]\t$tokens[3]
else if [ (count $tokens) -ge 2 ]
echo $tokens[2]
end
end
end
function __get_ant_targets_from_projecthelp -d "Get ant targets from projecthelp"
set -l buildfile $argv[1] # full path to buildfile
if [ \( -z "$XDG_CACHE_HOME" \) -o \( ! -d "$XDG_CACHE_HOME" \) ]
set XDG_CACHE_HOME "$HOME/.cache"
end
set -l cache_dir "$XDG_CACHE_HOME/fish/ant_completions"
mkdir -p $cache_dir
set -l cache_file $cache_dir/(fish_md5 -s $buildfile)
if [ ! -s "$cache_file" ]
# generate cache file if empty
__parse_ant_targets_from_projecthelp $buildfile >$cache_file
end
cat $cache_file
end
set -l tokens $argv
set -l buildfile (realpath -eq $buildfile (__get_buildfile $tokens))
if [ $status -ne 0 ]
return 1 # return nothing if buildfile does not exist
end
__get_ant_targets_from_projecthelp $buildfile
end
# completion for ant targets
complete -x -c ant -a "(__fish_complete_ant_targets)"
complete -x -c ant -a "(__fish_complete_ant_targets (commandline -co))"
# Script Options:
complete -f -c ant -l help -l h -d 'print help message and ant help'

View File

@@ -178,7 +178,7 @@ atom.io registry"
complete -x -c apm -n "__fish_apm_using_command login" -l token -d "Specify API token"
# outdated & upgrade & update
set -l upgrade_commands "outdated upgrade update"
set -l upgrade_commands "outdated upgrade update"
complete -f -c apm -n '__fish_apm_needs_command' -a $upgrade_commands -d "Upgrade out of date packages"
complete -f -c apm -n "__fish_apm_using_command $upgrade_commands" -l json -d "Output outdated packages as JSON array"
complete -x -c apm -n "__fish_apm_using_command $upgrade_commands" -l compatible -d "Only install packages/themes compatible with specified Atom version"

View File

@@ -1,9 +1,9 @@
function __fish_complete_apropos
if test (commandline -ct)
set str (commandline -ct)
apropos $str 2>/dev/null |sed -e "s/^\(.*$str\([^ ]*\).*\)\$/$str\2"\t"\1/"
end
if test (commandline -ct)
set str (commandline -ct)
apropos $str 2>/dev/null | sed -e "s/^\(.*$str\([^ ]*\).*\)\$/$str\2"\t"\1/"
end
end
complete -xc apropos -a '(__fish_complete_apropos)' -d "whatis entry"

View File

@@ -30,12 +30,12 @@ complete -r -c apt-cache -s c -l config-file -d "Specify config file"
complete -x -c apt-cache -s o -l option -d "Specify options"
function __fish_apt-cache_use_package -d 'Test if apt command should have packages as potential completion'
for i in (commandline -opc)
if contains -- $i contains show showpkg showsrc depends rdepends dotty policy
return 0
end
end
return 1
for i in (commandline -opc)
if contains -- $i contains show showpkg showsrc depends rdepends dotty policy
return 0
end
end
return 1
end
complete -c apt-cache -n '__fish_apt-cache_use_package' -a '(__fish_print_packages)' -d 'Package'

View File

@@ -2,6 +2,6 @@
#apt-extracttemplates
complete -c apt-extracttemplates -s h -l help -d "Display help and exit"
complete -r -c apt-extracttemplates -s t -d "Set temp dir"
complete -r -c apt-extracttemplates -s c -d "Specifiy config file"
complete -r -c apt-extracttemplates -s c -d "Specify config file"
complete -r -c apt-extracttemplates -s o -d "Specify options"

View File

@@ -11,7 +11,7 @@ complete -f -c apt-file -s i -l ignore-case -d "Do not expand pattern"
complete -f -c apt-file -s x -l regexp -d "Pattern is regexp"
complete -f -c apt-file -s V -l version -d "Display version and exit"
complete -f -c apt-file -s a -l architecture -d "Set arch"
complete -r -c apt-file -s s -l sources-list -a "(ls /etc/apt)" -d "Set sources.list file"
complete -r -c apt-file -s s -l sources-list -a '(set -l files /etc/apt/*; string replace /etc/apt/ "" -- $files)' -d "Set sources.list file"
complete -f -c apt-file -s l -l package-only -d "Only display package name"
complete -f -c apt-file -s F -l fixed-string -d "Do not expand pattern"
complete -f -c apt-file -s y -l dummy -d "Run in dummy mode"

View File

@@ -1,21 +1,21 @@
#completion for apt-get
function __fish_apt_no_subcommand -d 'Test if apt has yet to be given the subcommand'
for i in (commandline -opc)
if contains -- $i update upgrade dselect-upgrade dist-upgrade install remove purge source build-dep check clean autoclean changelog
return 1
end
end
return 0
for i in (commandline -opc)
if contains -- $i update upgrade dselect-upgrade dist-upgrade install remove purge source build-dep check clean autoclean changelog
return 1
end
end
return 0
end
function __fish_apt_use_package -d 'Test if apt command should have packages as potential completion'
for i in (commandline -opc)
if contains -- $i contains install remove purge build-dep changelog
return 0
end
end
return 1
for i in (commandline -opc)
if contains -- $i contains install remove purge build-dep changelog
return 0
end
end
return 1
end
complete -c apt-get -n '__fish_apt_use_package' -a '(__fish_print_packages)' -d 'Package'

View File

@@ -1,6 +1,6 @@
#apt-listbugs
complete -c apt-listbugs -s h -l help -d "Display help and exit"
complete -f -c apt-listbugs -s s -l severity -a "critical grave" -d "Set severity"
complete -f -c apt-listbugs -s s -l severity -a "critical grave" -d "Set severity"
complete -f -c apt-listbugs -s T -l tag -d "Tags you want to see"
complete -f -c apt-listbugs -s S -l stats -a "outstanding 'pending upload' resolved done open" -d "Bug-status you want to see"
complete -f -c apt-listbugs -s l -l showless -d "Ignore bugs in your system"

View File

@@ -1,21 +1,21 @@
#completion for apt-mark
function __fish_apt_no_subcommand -d 'Test if apt has yet to be given the subcommand'
for i in (commandline -opc)
if contains -- $i auto manual hold unhold showauto showmanual showhold
return 1
end
end
return 0
for i in (commandline -opc)
if contains -- $i auto manual hold unhold showauto showmanual showhold
return 1
end
end
return 0
end
function __fish_apt_use_package -d 'Test if apt command should have packages as potential completion'
for i in (commandline -opc)
if contains -- $i contains auto manual hold unhold
return 0
end
end
return 1
for i in (commandline -opc)
if contains -- $i contains auto manual hold unhold
return 0
end
end
return 1
end
complete -c apt-mark -n '__fish_apt_use_package' -a '(__fish_print_packages)' -d 'Package'

View File

@@ -1,5 +1,5 @@
#apt-show-versions
complete -c apt-show-source -s h -l help -d 'Display help and exit'
complete -c apt-show-versions -s h -l help -d 'Display help and exit'
complete -r -c apt-show-versions -s p -l packages -a '(apt-cache pkgnames)' -d 'Print PKG versions'
complete -f -c apt-show-versions -s r -l regex -d 'Using regex'
complete -f -c apt-show-versions -s u -l upgradeable -d 'Print only upgradeable packages'

View File

@@ -20,58 +20,59 @@ complete -c apt -n "__fish_seen_subcommand_from $pkg_subcmds" -a '(__fish_print_
complete -c apt -n "__fish_seen_subcommand_from $installed_pkg_subcmds" -a '(__fish_print_packages --installed | string match -re -- "(?:\\b|_)"(commandline -ct | string escape --style=regex) | head -n 250)' -d 'Package'
# Support flags
complete -x -f -c apt -s h -l help -d 'Display help'
complete -x -f -c apt -s v -l version -d 'Display version and exit'
complete -x -f -c apt -s h -l help -d 'Display help'
complete -x -f -c apt -s v -l version -d 'Display version and exit'
# General options
complete -f -c apt -s o -l option -d 'Set a configuration option'
complete -f -c apt -s c -l config-file -d 'Configuration file'
complete -f -c apt -s t -d 'Target release'
complete -f -c apt -s o -l option -d 'Set a configuration option'
complete -f -c apt -s c -l config-file -d 'Configuration file'
complete -f -c apt -s t -d 'Target release'
# List
__fish_apt_subcommand list -d 'List packages'
__fish_apt_option list -l installed -d 'Installed packages'
__fish_apt_option list -l upgradable -d 'Upgradable packages'
__fish_apt_option list -l all-versions -d 'Show all versions of any package'
__fish_apt_subcommand list -d 'List packages'
__fish_apt_option list -l installed -d 'Installed packages'
__fish_apt_option list -l upgradable -d 'Upgradable packages'
__fish_apt_option list -l all-versions -d 'Show all versions of any package'
# Search
__fish_apt_subcommand search -r -d 'Search for packages'
__fish_apt_subcommand search -r -d 'Search for packages'
# Search
__fish_apt_subcommand show -r -d 'Show package information'
__fish_apt_subcommand show -r -d 'Show package information'
# Install
__fish_apt_subcommand install -r -d 'Install packages'
__fish_apt_subcommand install -r -d 'Install packages'
__fish_apt_option install -l reinstall -d 'Reinstall package'
# Remove
__fish_apt_subcommand remove -r -d 'Remove packages'
__fish_apt_subcommand remove -r -d 'Remove packages'
# Edit sources
__fish_apt_subcommand edit-sources -d 'Edit sources list'
__fish_apt_subcommand edit-sources -d 'Edit sources list'
# Update
__fish_apt_subcommand update -x -d 'Update package list'
__fish_apt_subcommand update -x -d 'Update package list'
# Upgrade
__fish_apt_subcommand upgrade -r -d 'Upgrade packages'
__fish_apt_subcommand upgrade -r -d 'Upgrade packages'
# Full Upgrade
__fish_apt_subcommand full-upgrade -r -d 'Upgrade packages, removing others when needed'
__fish_apt_subcommand full-upgrade -r -d 'Upgrade packages, removing others when needed'
# Purge
__fish_apt_subcommand purge -x -d 'Remove packages and delete their config files'
__fish_apt_subcommand purge -x -d 'Remove packages and delete their config files'
# Changelog
__fish_apt_subcommand changelog -r -d 'Download and display package changelog'
__fish_apt_subcommand changelog -r -d 'Download and display package changelog'
# Autoremove
__fish_apt_subcommand autoremove -d 'Remove packages no longer needed as dependencies'
__fish_apt_subcommand autoremove -d 'Remove packages no longer needed as dependencies'
# Policy
__fish_apt_subcommand policy -x -d 'Display source or package priorities'
__fish_apt_subcommand policy -x -d 'Display source or package priorities'
# Depends
__fish_apt_subcommand depends -r -d 'List package dependencies'
__fish_apt_subcommand depends -r -d 'List package dependencies'
# Rdepends
__fish_apt_subcommand rdepends -r -d 'List package reverse dependencies'
__fish_apt_subcommand rdepends -r -d 'List package reverse dependencies'

View File

@@ -1,68 +1,68 @@
#completion for aptitude
function __fish_apt_no_subcommand -d 'Test if aptitude has yet to be given the subcommand'
for i in (commandline -opc)
if contains -- $i autoclean clean forget-new keep-all update safe-upgrade changelog full-upgrade download forbid-version hold install keep markauto purge reinstall remove show unhold unmarkauto search help
return 1
end
end
return 0
function __fish_apt_no_subcommand -d 'Test if aptitude has yet to be given the subcommand'
for i in (commandline -opc)
if contains -- $i autoclean clean forget-new keep-all update safe-upgrade changelog full-upgrade download forbid-version hold install keep markauto purge reinstall remove show unhold unmarkauto search help
return 1
end
end
return 0
end
function __fish_apt_use_package -d 'Test if aptitude command should have packages as potential completion'
for i in (commandline -opc)
if contains -- $i changelog full-upgrade download forbid-version hold install keep-all markauto purge reinstall remove show unhold unmarkauto
return 0
end
end
return 1
function __fish_apt_use_package -d 'Test if aptitude command should have packages as potential completion'
for i in (commandline -opc)
if contains -- $i changelog full-upgrade download forbid-version hold install keep-all markauto purge reinstall remove show unhold unmarkauto
return 0
end
end
return 1
end
complete -c aptitude -n '__fish_apt_use_package' -a '(__fish_print_packages)' -d 'Package'
complete -c aptitude -n '__fish_apt_use_package' -a '(__fish_print_packages)' -d 'Package'
complete -c aptitude -s h -l help -d 'Display a brief help message. Identical to the help action'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'autoclean' -d 'Remove any cached packages which can no longer be downloaded'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'clean' -d 'Remove all downloaded .deb files from the package cache directory'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'forget-new' -d 'Forget all internal information about what packages are \'new\''
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'keep-all' -d 'Cancel all scheduled actions on all packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'update' -d 'Update the list of available packages from the apt sources'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'safe-upgrade' -d 'Upgrade installed packages to their most recent version'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'changelog' -d 'Download and displays the Debian changelog for the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'full-upgrade' -d 'Upgrade, removing or installing packages as necessary'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'download' -d 'Download the packages to the current directory'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'forbid-version' -d 'Forbid the upgrade to a particular version'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'hold' -d 'Ignore the packages by future upgrade commands'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'install' -d 'Install the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'keep' -d 'Cancel any scheduled actions on the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'markauto' -d 'Mark packages as automatically installed'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'purge' -d 'Remove and delete all associated configuration and data files'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'reinstall' -d 'Reinstall the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'remove' -d 'Remove the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'show' -d 'Display detailed information about the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'unhold' -d 'Consider the packages by future upgrade commands'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'unmarkauto' -d 'Mark packages as manually installed'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'search' -d 'Search for packages matching one of the patterns'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'help' -d 'Display brief summary of the available commands and options'
complete -c aptitude -s h -l help -d 'Display a brief help message. Identical to the help action'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'autoclean' -d 'Remove any cached packages which can no longer be downloaded'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'clean' -d 'Remove all downloaded .deb files from the package cache directory'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'forget-new' -d 'Forget all internal information about what packages are \'new\''
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'keep-all' -d 'Cancel all scheduled actions on all packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'update' -d 'Update the list of available packages from the apt sources'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'safe-upgrade' -d 'Upgrade installed packages to their most recent version'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'changelog' -d 'Download and displays the Debian changelog for the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'full-upgrade' -d 'Upgrade, removing or installing packages as necessary'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'download' -d 'Download the packages to the current directory'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'forbid-version' -d 'Forbid the upgrade to a particular version'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'hold' -d 'Ignore the packages by future upgrade commands'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'install' -d 'Install the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'keep' -d 'Cancel any scheduled actions on the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'markauto' -d 'Mark packages as automatically installed'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'purge' -d 'Remove and delete all associated configuration and data files'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'reinstall' -d 'Reinstall the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'remove' -d 'Remove the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'show' -d 'Display detailed information about the packages'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'unhold' -d 'Consider the packages by future upgrade commands'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'unmarkauto' -d 'Mark packages as manually installed'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'search' -d 'Search for packages matching one of the patterns'
complete -f -n '__fish_apt_no_subcommand' -c aptitude -a 'help' -d 'Display brief summary of the available commands and options'
complete -c aptitude -s D -l show-deps -d 'Show explanations of automatic installations and removals'
complete -c aptitude -s d -l download-only -d 'Download Only'
complete -c aptitude -s f -l fix-broken -d 'Correct broken dependencies'
complete -c aptitude -l purge-unused -d 'Purge packages that are not required by any installed package'
complete -c aptitude -s P -l prompt -d 'Always display a prompt'
complete -c aptitude -s R -l without-recommends -d 'Do not treat recommendations as dependencies'
complete -c aptitude -s r -l with-recommends -d 'Treat recommendations as dependencies'
complete -c aptitude -s s -l simulate -d 'Don\'t perform the actions. Just show them'
complete -c aptitude -l schedule-only -d 'Schedule operations to be performed in the future'
complete -c aptitude -s q -l quiet -d 'Suppress incremental progress indicators'
complete -c aptitude -s V -l show-versions -d 'Show which versions of packages will be installed'
complete -c aptitude -s v -l verbose -d 'Display extra information'
complete -c aptitude -l version -d 'Display the version of aptitude and compile information'
complete -c aptitude -l visual-preview -d 'Start up the visual interface and display its preview screen'
complete -c aptitude -s y -l assume-yes -d 'Assume the answer yes for all question prompts'
complete -c aptitude -s Z -d 'Show how much disk space will be used or freed'
complete -r -c aptitude -s F -l display-format -d 'Specify the format to be used by the search command'
complete -r -c aptitude -s t -l target-release -d 'Set the release from which packages should be installed'
complete -r -c aptitude -s O -l sort -d 'Specify the order for the output from the search command'
complete -r -c aptitude -s o -d 'Set a configuration file option directly'
complete -r -c aptitude -s w -l width -d 'Specify the display width for the output from the search command'
complete -c aptitude -s D -l show-deps -d 'Show explanations of automatic installations and removals'
complete -c aptitude -s d -l download-only -d 'Download Only'
complete -c aptitude -s f -l fix-broken -d 'Correct broken dependencies'
complete -c aptitude -l purge-unused -d 'Purge packages that are not required by any installed package'
complete -c aptitude -s P -l prompt -d 'Always display a prompt'
complete -c aptitude -s R -l without-recommends -d 'Do not treat recommendations as dependencies'
complete -c aptitude -s r -l with-recommends -d 'Treat recommendations as dependencies'
complete -c aptitude -s s -l simulate -d 'Don\'t perform the actions. Just show them'
complete -c aptitude -l schedule-only -d 'Schedule operations to be performed in the future'
complete -c aptitude -s q -l quiet -d 'Suppress incremental progress indicators'
complete -c aptitude -s V -l show-versions -d 'Show which versions of packages will be installed'
complete -c aptitude -s v -l verbose -d 'Display extra information'
complete -c aptitude -l version -d 'Display the version of aptitude and compile information'
complete -c aptitude -l visual-preview -d 'Start up the visual interface and display its preview screen'
complete -c aptitude -s y -l assume-yes -d 'Assume the answer yes for all question prompts'
complete -c aptitude -s Z -d 'Show how much disk space will be used or freed'
complete -r -c aptitude -s F -l display-format -d 'Specify the format to be used by the search command'
complete -r -c aptitude -s t -l target-release -d 'Set the release from which packages should be installed'
complete -r -c aptitude -s O -l sort -d 'Specify the order for the output from the search command'
complete -r -c aptitude -s o -d 'Set a configuration file option directly'
complete -r -c aptitude -s w -l width -d 'Specify the display width for the output from the search command'

View File

@@ -41,7 +41,7 @@ complete -f -c arc -n '__fish_arc_needs_command' -l conduit-token -d 'Specify th
complete -f -c arc -n '__fish_arc_needs_command' -l conduit-version -d 'Force a version'
complete -f -c arc -n '__fish_arc_needs_command' -l conduit-timeout -d 'Sets the timeout'
complete -f -c arc -n '__fish_arc_needs_command' -l config -d 'Sets a config'
complete -f -c arc -n '__fish_arc_needs_command' -l skip-arcconfig -d 'Skip the working copy configuration file'
complete -f -c arc -n '__fish_arc_needs_command' -l skip-arcconfig -d 'Skip the working copy configuration file'
complete -c arc -n '__fish_arc_needs_command' -l arcrc-file -d 'Use provided file instead of ~/.arcrc'
### shell-complete

View File

@@ -22,5 +22,5 @@ complete -c asp -n "not __fish_seen_subcommand_from $commands" -a untrack -d "Re
# This will run into the description race.
complete -c asp -n "__fish_seen_subcommand_from checkout {diff,short,}log export list-{arches,repos} show update" -a "(asp list-all | string replace -r '.*/' '')" -f
complete -c asp -n "__fish_seen_subcommand_from checkout {diff,short,}log export list-{arches,repos} show update untrack" -a "(asp list-local | string replace -r '.*/' '')" -f \
-d "Locally tracked package"
-d "Locally tracked package"

273
share/completions/aws.fish Normal file
View File

@@ -0,0 +1,273 @@
# These are very much incomplete completions for the aws-cli suite.
# In addition to a complete list of services, the `aws s3` completions are mostly complete
# (and are the primary reason this file exists). The automatically generated completions
# for `aws` via `fish_update_completions` are pretty useless due to non-standard formatting.
function __s3_is_maybe_bucket
commandline -ct | string match -qr -- '^(|s|s3|s3:?/?/?[^/]*)$'
end
function __s3_is_bucket
commandline -ct | string match -q -r -- '^s3:/?/?[^/]*$'
end
function __s3_is_remote_path
commandline -ct | string match -q -r -- "^s3://.+/.*"
end
function __s3_ls_buckets
aws s3 ls | string replace -rf '.* (\S+)$' 's3://$1/'
end
function __s3_ls_dir
set -l dir (commandline -ct | string replace -rf '(s3://.*/).*' '$1')
printf "$dir%s\n" (aws s3 ls $dir 2>/dev/null | string replace -fr '^(:?\S+ +\S+ +\S+ |^.*PRE )(.*)' '$2')
end
# Determines whether the first non-switch argument to `aws s3` was in $argv
# This accounts for things like `aws --debug s3 foo ... s3://...`
function __s3_cmd_in
set -l is_s3 0
set -l tokens (commandline -co)
for token in $tokens[2..-1]
# Ignore switches everywhere
if string match -qr -- "^--" $token
continue
end
# Check if `aws` command is `s3`
if test $is_s3 -eq 0
if string match -q -- "s3" $token
set is_s3 1
continue
else
return 1
end
end
# Check if `aws s3` sub-sub-command is in $argv
if contains $token $argv
return 0
else
return 1
end
end
return 1
end
# Determines whether the first non-switch argument to `aws` was in $argv
function __aws_cmd_in
set -l tokens (commandline -co)
for token in $tokens[2..-1]
if string match -qr "^--" -- $token
# Ignore switches everywhere
continue
else if contains $token $argv
return 0
else
return 1
end
end
return 1
end
# S3 completions
complete -c 'aws' -n "__fish_prev_arg_in s3" -xa "cp mv rm help sync ls mb mv presign rb website"
# When completing a remote path, complete the bucket name first, then based off
# the bucket name, we can complete the path itself.
# Commands that take only remote parameters (cannot operate on local files).
complete -c 'aws' -n "__s3_is_maybe_bucket && __s3_cmd_in ls rb rm" -xa "(__s3_ls_buckets)"
# Commands that can operate on local or remote files. To prevent the shell
# locking up unnecessarily, only complete if no argument was specified or if the
# argument being specified could be an S3 path.
complete -c 'aws' -n "__s3_is_maybe_bucket && __s3_cmd_in mv cp presign mb sync" -a "(__s3_ls_buckets)"
# Complete the paths themselves
complete -c 'aws' -n "__s3_is_remote_path" -xa "(__s3_ls_dir)"
complete -c 'aws' -n "__s3_is_bucket" -xa "(__s3_ls_buckets)"
# This list is extracted from the output of `aws help`, which can't be ingested directly,
# as it emits considerable ANSI output and other terminal control characters.
set -l aws_services \
acm \
acm-pca \
alexaforbusiness \
amplify \
apigateway \
apigatewaymanagementapi \
apigatewayv2 \
application-autoscaling \
appmesh \
appstream \
appsync \
athena \
autoscaling \
autoscaling-plans \
backup \
batch \
budgets \
ce \
chime \
cloud9 \
clouddirectory \
cloudformation \
cloudfront \
cloudhsm \
cloudhsmv2 \
cloudsearch \
cloudsearchdomain \
cloudtrail \
cloudwatch \
codebuild \
codecommit \
codepipeline \
codestar \
cognito-identity \
cognito-idp \
cognito-sync \
comprehend \
comprehendmedical \
configservice \
configure \
connect \
cur \
datapipeline \
datasync \
dax \
deploy \
devicefarm \
directconnect \
discovery \
dlm \
dms \
docdb \
ds \
dynamodb \
dynamodbstreams \
ec2 \
ecr \
ecs \
efs \
eks \
elasticache \
elasticbeanstalk \
elastictranscoder \
elb \
elbv2 \
emr \
es \
events \
firehose \
fms \
fsx \
gamelift \
glacier \
globalaccelerator \
glue \
greengrass \
guardduty \
health \
help \
history \
iam \
importexport \
inspector \
iot \
iot-data \
iot-jobs-data \
iot1click-devices \
iot1click-projects \
iotanalytics \
kafka \
kinesis \
kinesis-video-archived-media \
kinesis-video-media \
kinesisanalytics \
kinesisanalyticsv2 \
kinesisvideo \
kms \
lambda \
lex-models \
lex-runtime \
license-manager \
lightsail \
logs \
machinelearning \
macie \
marketplace-entitlement \
marketplacecommerceanalytics \
mediaconnect \
mediaconvert \
medialive \
mediapackage \
mediastore \
mediastore-data \
mediatailor \
meteringmarketplace \
mgh \
mobile \
mq \
mturk \
neptune \
opsworks \
opsworks-cm \
organizations \
pi \
pinpoint \
pinpoint-email \
pinpoint-sms-voice \
polly \
pricing \
quicksight \
ram \
rds \
rds-data \
redshift \
rekognition \
resource-groups \
resourcegroupstaggingapi \
robomaker \
route53 \
route53domains \
route53resolver \
s3 \
s3api \
s3control \
sagemaker \
sagemaker-runtime \
sdb \
secretsmanager \
securityhub \
serverlessrepo \
servicecatalog \
servicediscovery \
ses \
shield \
signer \
sms \
snowball \
sns \
sqs \
ssm \
stepfunctions \
storagegateway \
sts \
support \
swf \
textract \
transcribe \
transfer \
translate \
waf \
waf-regional \
workdocs \
worklink \
workmail \
workspaces \
xray
complete -c aws -n '__fish_is_first_token' -xa "$aws_services"

View File

@@ -0,0 +1,88 @@
# Generated by hand against bat 0.12.0.
# bat is at <https://github.com/sharkdp/bat>.
# TODO: Have --map-syntax properly suggest from- and to-languages.
# NOTE: The completion for --style wont help the user write anything in the comma-separated-list form.
function __bat_complete_languages_and_extensions -d 'All languages and their filenames/extensions, one per line'
command bat --list-languages | string split : | string split ,
end
function __bat_complete_language_extensions -d 'All language extensions/names, one per line'
command bat --list-languages | cut -d : -f 2 | string split ,
end
function __bat_complete_themes -d 'All themes, one per line'
command bat --list-themes
end
set -l style_opts '
auto\tdefault
full\t
plain\t
changes\t
header\t
grid\t
numbers\t
'
set -l color_opts '
auto\tdefault
never\t
always\t
'
set -l italic_text_opts '
always\t
never\tdefault
'
set -l decorations_opts "$color_opts"
set -l paging_opts "$color_opts"
set -l wrap_opts '
auto\tdefault
never\t
character\t
'
# While --tabs theoretically takes any number, most people should be OK with these. Specifying a list lets me explain what 0 does.
set -l tabs_opts '
0\tpasses tabs through directly
1\t
2\t
4\t
8\t
'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -s l -l language -a '(__bat_complete_languages_and_extensions)' -d 'Set language for syntax highlighting'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -f -s L -l list-language -d 'List supported languages for syntax highlighting'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -s m -l map-syntax -d 'Map file name/extension to existing syntax'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l theme -a '(__bat_complete_themes)' -d 'Set theme for syntax highlighting'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -f -l list-themes -d 'List syntax-highlighting themes'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l style -a "$style_opts" -d 'Choose what to add to the file contents'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -s p -l plain -d 'Show no decorations; -pp disables paging too'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -s n -l number -d 'Only show line numbers and no other decorations'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -s A -l show-all -d 'Show non-printable characters'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -s r -l line-range -d 'Only print lines from [M]:[N] (either optional)'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -s H -l highlight-line -d 'Highlight the given line'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l color -ka "$color_opts" -d 'Specify when to use colors'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l italic-text -ka "$italic_text_opts" -d 'Specify when to use ANSI italic-text sequences'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l decorations -ka "$decorations_opts" -d 'Specify when to use --style decorations'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l paging -ka "$paging_opts" -d 'Specify when to use a pager'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l pager -d 'Specify what pager to use'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l wrap -ka "$wrap_opts" -d 'Specify text-wrapping mode'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l tabs -a "$tabs_opts" -d 'Sets tab width to N spaces'
# Dont suggest the always-ignored added-only-for-POSIX-compliance -u/--unbuffered. Output is always unbuffered.
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l terminal-width -d 'Explicitly set terminal width, optionally prefixed with +/-'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -s h -l help -d 'Print help'
complete -c bat -n 'not __fish_seen_subcommand_from cache' -s V -l version -d 'Show version information'
# cache things
complete -c bat -n '__fish_use_subcommand' -a cache -d 'Manage syntax-definition and theme cache'
complete -c bat -n '__fish_seen_subcommand_from cache' -f -s b -l build -d 'Initialize/update cache from the source directory'
complete -c bat -n '__fish_seen_subcommand_from cache' -f -s c -l clear -d 'Remove cached definitions and themes'
complete -c bat -n '__fish_seen_subcommand_from cache' -r -l source -d 'Specify directory to load syntaxes/themes from'
complete -c bat -n '__fish_seen_subcommand_from cache' -r -l target -d 'Specify directory to store cached syntaxes/themes'
complete -c bat -n '__fish_seen_subcommand_from cache' -f -l blank -d 'Create completely new syntax/theme sets instead of appending to the defaults'
complete -c bat -n '__fish_seen_subcommand_from cache' -f -s h -l help -d 'Print help about cache management'

View File

@@ -7,9 +7,9 @@
complete -c bd -A -f
complete -c bd -s c -d "Classic mode: goes back to the first directory named as the string"
complete -c bd -s s -d "Seems mode: goes back to the first directory containing string"
complete -c bd -s i -d "Case insensitive move (implies seems mode)"
complete -c bd -s c -d "Classic mode: goes back to the first directory named as the string"
complete -c bd -s s -d "Seems mode: goes back to the first directory containing string"
complete -c bd -s i -d "Case insensitive move (implies seems mode)"
complete -c bd -s h -x -d "Display help and exit"
function __fish_bd_complete_dirs

View File

@@ -0,0 +1,2 @@
complete -c begin -s h -l help -d 'Display help and exit'
complete -c begin -xa '(__fish_complete_subcommand --allow-functions-and-builtins)'

View File

@@ -43,14 +43,16 @@ function __fish_bind_test2
end
complete -c bind -f
complete -c bind -s a -l all -d 'Show unavailable key bindings/erase all bindings'
complete -c bind -s e -l erase -d 'Erase mode'
complete -c bind -s f -l function-names -d 'Print names of available functions'
complete -c bind -s h -l help -d "Display help and exit"
complete -c bind -s k -l key -d 'Specify key name, not sequence'
complete -c bind -s K -l key-names -d 'Print names of available keys'
complete -c bind -s m -l mode -d 'Add to named bind mode'
complete -c bind -s M -l new-mode -d 'Change current bind mode to named mode'
complete -c bind -s M -l mode -d 'Specify the bind mode that the bind is used in' -xa '(bind -L)'
complete -c bind -s m -l sets-mode -d 'Change current mode after bind is executed' -xa '(bind -L)'
complete -c bind -s L -l list-modes -d 'Display a list of defined bind modes'
complete -c bind -n __fish_bind_test1 -a '(bind --key-names)' -d 'Key name' -x
complete -c bind -n __fish_bind_test2 -a '(bind --function-names)' -d 'Function name' -x

View File

@@ -1,92 +1,92 @@
set -l subcommands add-blob alias-env attach-disk blobs cancel-task clean-up \
cloud-check cloud-config config configs cpi-config create-env create-release \
delete-config delete-deployment delete-disk delete-env delete-release \
delete-snapshot delete-snapshots delete-stemcell delete-vm deploy deployment \
deployments diff-config disks environment environments errands event events \
export-release finalize-release generate-job generate-package help ignore \
init-release inspect-release instances interpolate locks log-in log-out logs \
manifest orphan-disk recreate releases remove-blob repack-stemcell \
reset-release restart run-errand runtime-config scp snapshots ssh start \
stemcells stop sync-blobs take-snapshot task tasks unignore \
update-cloud-config update-config update-cpi-config update-resurrection \
update-runtime-config upload-blobs upload-release upload-stemcell variables \
vendor-package vms
cloud-check cloud-config config configs cpi-config create-env create-release \
delete-config delete-deployment delete-disk delete-env delete-release \
delete-snapshot delete-snapshots delete-stemcell delete-vm deploy deployment \
deployments diff-config disks environment environments errands event events \
export-release finalize-release generate-job generate-package help ignore \
init-release inspect-release instances interpolate locks log-in log-out logs \
manifest orphan-disk recreate releases remove-blob repack-stemcell \
reset-release restart run-errand runtime-config scp snapshots ssh start \
stemcells stop sync-blobs take-snapshot task tasks unignore \
update-cloud-config update-config update-cpi-config update-resurrection \
update-runtime-config upload-blobs upload-release upload-stemcell variables \
vendor-package vms
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'add-blob' --description "Add blob"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'alias-env' --description "Alias environment to save URL and CA certificate"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'attach-disk' --description "Attaches disk to an instance"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'blobs' --description "List blobs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'cancel-task' --description "Cancel task at its next checkpoint"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'clean-up' --description "Clean up releases, stemcells, disks, etc."
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'cloud-check' --description "Cloud consistency check and interactive repair"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'cloud-config' --description "Show current cloud config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'config' --description "Show current config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'configs' --description "List configs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'cpi-config' --description "Show current CPI config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'create-env' --description "Create or update BOSH environment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'create-release' --description "Create release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-config' --description "Delete config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-deployment' --description "Delete deployment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-disk' --description "Delete disk"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-env' --description "Delete BOSH environment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-release' --description "Delete release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-snapshot' --description "Delete snapshot"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-snapshots' --description "Delete all snapshots in a deployment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-stemcell' --description "Delete stemcell"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-vm' --description "Delete VM"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'deploy' --description "Update deployment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'deployment' --description "Show deployment information"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'deployments' --description "List deployments"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'diff-config' --description "Diff two configs by ID"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'disks' --description "List disks"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'environment' --description "Show environment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'environments' --description "List environments"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'errands' --description "List errands"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'event' --description "Show event details"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'events' --description "List events"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'export-release' --description "Export the compiled release to a tarball"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'finalize-release' --description "Create final release from dev release tarball"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'generate-job' --description "Generate job"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'generate-package' --description "Generate package"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'help' --description "Show this help message"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'ignore' --description "Ignore an instance"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'init-release' --description "Initialize release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'inspect-release' --description "List release contents such as jobs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'instances' --description "List all instances in a deployment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'interpolate' --description "Interpolates variables into a manifest"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'locks' --description "List current locks"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'log-in' --description "Log in"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'log-out' --description "Log out"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'logs' --description "Fetch logs from instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'manifest' --description "Show deployment manifest"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'orphan-disk' --description "Orphan disk"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'recreate' --description "Recreate instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'releases' --description "List releases"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'remove-blob' --description "Remove blob"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'repack-stemcell' --description "Repack stemcell"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'reset-release' --description "Reset release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'restart' --description "Restart instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'run-errand' --description "Run errand"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'runtime-config' --description "Show current runtime config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'scp' --description "SCP to/from instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'snapshots' --description "List snapshots"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'ssh' --description "SSH into instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'start' --description "Start instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'stemcells' --description "List stemcells"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'stop' --description "Stop instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'sync-blobs' --description "Sync blobs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'take-snapshot' --description "Take snapshot"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'task' --description "Show task status and start tracking its output"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'tasks' --description "List running or recent tasks"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'unignore' --description "Unignore an instance"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-cloud-config' --description "Update current cloud config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-config' --description "Update config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-cpi-config' --description "Update current CPI config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-resurrection' --description "Enable/disable resurrection"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-runtime-config' --description "Update current runtime config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'upload-blobs' --description "Upload blobs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'upload-release' --description "Upload release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'upload-stemcell' --description "Upload stemcell"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'variables' --description "List variables"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'vendor-package' --description "Vendor package"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'vms' --description "List all VMs in all deployments"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'add-blob' --description "Add blob"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'alias-env' --description "Alias environment to save URL and CA certificate"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'attach-disk' --description "Attaches disk to an instance"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'blobs' --description "List blobs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'cancel-task' --description "Cancel task at its next checkpoint"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'clean-up' --description "Clean up releases, stemcells, disks, etc."
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'cloud-check' --description "Cloud consistency check and interactive repair"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'cloud-config' --description "Show current cloud config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'config' --description "Show current config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'configs' --description "List configs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'cpi-config' --description "Show current CPI config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'create-env' --description "Create or update BOSH environment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'create-release' --description "Create release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-config' --description "Delete config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-deployment' --description "Delete deployment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-disk' --description "Delete disk"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-env' --description "Delete BOSH environment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-release' --description "Delete release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-snapshot' --description "Delete snapshot"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-snapshots' --description "Delete all snapshots in a deployment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-stemcell' --description "Delete stemcell"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'delete-vm' --description "Delete VM"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'deploy' --description "Update deployment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'deployment' --description "Show deployment information"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'deployments' --description "List deployments"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'diff-config' --description "Diff two configs by ID"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'disks' --description "List disks"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'environment' --description "Show environment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'environments' --description "List environments"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'errands' --description "List errands"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'event' --description "Show event details"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'events' --description "List events"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'export-release' --description "Export the compiled release to a tarball"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'finalize-release' --description "Create final release from dev release tarball"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'generate-job' --description "Generate job"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'generate-package' --description "Generate package"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'help' --description "Show this help message"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'ignore' --description "Ignore an instance"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'init-release' --description "Initialize release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'inspect-release' --description "List release contents such as jobs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'instances' --description "List all instances in a deployment"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'interpolate' --description "Interpolates variables into a manifest"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'locks' --description "List current locks"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'log-in' --description "Log in"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'log-out' --description "Log out"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'logs' --description "Fetch logs from instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'manifest' --description "Show deployment manifest"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'orphan-disk' --description "Orphan disk"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'recreate' --description "Recreate instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'releases' --description "List releases"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'remove-blob' --description "Remove blob"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'repack-stemcell' --description "Repack stemcell"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'reset-release' --description "Reset release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'restart' --description "Restart instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'run-errand' --description "Run errand"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'runtime-config' --description "Show current runtime config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'scp' --description "SCP to/from instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'snapshots' --description "List snapshots"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'ssh' --description "SSH into instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'start' --description "Start instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'stemcells' --description "List stemcells"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'stop' --description "Stop instance(s)"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'sync-blobs' --description "Sync blobs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'take-snapshot' --description "Take snapshot"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'task' --description "Show task status and start tracking its output"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'tasks' --description "List running or recent tasks"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'unignore' --description "Unignore an instance"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-cloud-config' --description "Update current cloud config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-config' --description "Update config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-cpi-config' --description "Update current CPI config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-resurrection' --description "Enable/disable resurrection"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'update-runtime-config' --description "Update current runtime config"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'upload-blobs' --description "Upload blobs"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'upload-release' --description "Upload release"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'upload-stemcell' --description "Upload stemcell"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'variables' --description "List variables"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'vendor-package' --description "Vendor package"
complete -f -n "__fish_use_subcommand $subcommands" -c bosh -a 'vms' --description "List all VMs in all deployments"

View File

@@ -1,5 +1,5 @@
function __bower_cmds
echo -en "cache\tManage bower cache
echo -en "cache\tManage bower cache
help\tDisplay help information about Bower
home\tOpens a package homepage into your favorite browser
info\tInfo of a particular package
@@ -20,7 +20,7 @@ version\tBump a package version
end
function __bower_args
echo -en "-f\tMakes various commands more forceful
echo -en "-f\tMakes various commands more forceful
--force\tMakes various commands more forceful
-j\tOutput consumable JSON
--json\tOutput consumable JSON
@@ -41,20 +41,27 @@ function __bower_args
end
function __bower_matching_pkgs
bower search (commandline -ct) | string match -r "\S+[^\s]" | string match -v "Search"
bower search (commandline -ct) | string match -r "\S+[^\s]" | string match -v "Search"
end
# Output of `bower list` is a) slow, b) convoluted. Use `jq` instead.
# Output of `bower list` is a) slow, b) convoluted. Use `python` or `jq` instead.
function __bower_list_installed
if not type -q jq
return 1
end
if not test -e bower.json
return 1
end
if not test -e bower.json
return 1
end
if set -l python (__fish_anypython)
# Warning: That weird indentation is necessary, because python.
$python -c 'import json, sys; data = json.load(sys.stdin);
for k,v in data["dependencies"].items(): print(k + "\t" + v[:18])' bower.json 2>/dev/null
return
end
jq -r '.dependencies | to_entries[] | .key' bower.json
if not type -q jq
return 1
end
jq -r '.dependencies | to_entries[] | .key' bower.json
end
complete -c bower -n "__fish_is_first_token" -x -a '(__bower_cmds)'

View File

@@ -1,507 +1,3 @@
function __fish_brew_get_cmd
for c in (commandline -opc)
if not string match -q -- '-*' $c
echo $c
end
end
end
function __fish_brew_needs_command
set cmd (__fish_brew_get_cmd)
if not set -q cmd[2]
return 0
end
return 1
end
function __fish_brew_using_command
set index 2
if set -q argv[2]
set index $argv[2]
end
set cmd (__fish_brew_get_cmd)
if set -q cmd[$index]
if [ $argv[1] = $cmd[$index] ]
return 0
end
end
return 1
end
function __fish_brew_formulae
# list all local formula, do not use `brew search some_text` against searching online
# TODO fix the problem with `tap-pin`, tap-pin will modify the priority
# If you pin your custom tap for VIM, you should
# `brew install homebrew/core/vim` to install VIM from `core` repo
# `brew install vim` to install VIM from more prior repo
# but `brew search` won't change display for custom VIM and core VIM
# 'vim' for core VIM
# 'custUser/custRepo/vim' for more prior VIM
# more info: https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/brew-tap.md#formula-duplicate-names
brew search
end
function __fish_brew_installed_formulas
brew list
end
function __fish_brew_leaves
brew leaves
end
function __fish_brew_outdated_formulas
brew outdated
end
function __fish_brew_pinned_formulas
brew list --pinned
end
function __fish_brew_taps
brew tap
end
###########################
# subcommand initializing #
###########################
########
# cask #
########
function __fish_brew_is_subcommand_cask
if __fish_brew_using_command cask
for action in $argv
if __fish_brew_using_command $action 3
return 0
end
end
end
return 1
end
function __fish_brew_needs_cask_action
if __fish_brew_using_command cask
set cmd (__fish_brew_get_cmd)
if not set -q cmd[3]
return 0
end
end
return 1
end
function __fish_brew_casks
brew search --casks
end
function __fish_brew_casks_installed
brew cask list
end
############
# services #
############
function __fish_brew_is_subcommand_services
if __fish_brew_using_command services
for action in $argv
if __fish_brew_using_command $action 3
return 0
end
end
end
return 1
end
function __fish_brew_needs_services_action
if __fish_brew_using_command services
set cmd (__fish_brew_get_cmd)
if not set -q cmd[3]
return 0
end
end
return 1
end
function __fish_brew_services
brew services list | awk '{if (NR>1) print $1}'
end
#####################
# brew commands #
# (brew cask below) #
#####################
# audit
complete -f -c brew -n '__fish_brew_needs_command' -a audit -d 'Check formula'
complete -f -c brew -n '__fish_brew_using_command audit' -a '(__fish_brew_formulae)'
# bottle
complete -f -c brew -n '__fish_brew_needs_command' -a bottle -d 'Create a binary package'
complete -f -c brew -n '__fish_brew_using_command bottle' -l 'homebrew-developer' -d 'Output developer debug information'
complete -f -c brew -n '__fish_brew_using_command bottle' -l 'no-revision' -d 'Do not bump the bottle revision number'
complete -f -c brew -n '__fish_brew_using_command bottle' -l 'rb' -d 'Write bottle block to a Ruby source file'
complete -f -c brew -n '__fish_brew_using_command bottle' -l 'write' -d 'Write bottle block to formula file'
complete -f -c brew -n '__fish_brew_using_command bottle' -l 'merge' -d 'Merge multiple bottle outputs'
# cask
complete -f -c brew -n '__fish_brew_needs_command' -a cask -d 'Manage installed casks'
# cat
complete -f -c brew -n '__fish_brew_needs_command' -a cat -d 'Display formula'
complete -f -c brew -n '__fish_brew_using_command cat' -a '(__fish_brew_formulae)'
# cleanup
complete -f -c brew -n '__fish_brew_needs_command' -a cleanup -d 'Remove old installed versions'
complete -f -c brew -n '__fish_brew_using_command cleanup' -l force -d 'Remove out-of-date keg-only brews as well'
complete -f -c brew -n '__fish_brew_using_command cleanup' -l dry-run -d 'Show what files would be removed'
complete -f -c brew -n '__fish_brew_using_command cleanup' -s n -d 'Show what files would be removed'
complete -f -c brew -n '__fish_brew_using_command cleanup' -s s -d 'Scrub the cache'
complete -f -c brew -n '__fish_brew_using_command cleanup' -a '(__fish_brew_installed_formulas)'
# create
complete -f -c brew -n '__fish_brew_needs_command' -a create -d 'Create new formula from URL'
complete -f -c brew -n '__fish_brew_using_command create' -l cmake -d 'Use template for CMake-style build'
complete -f -c brew -n '__fish_brew_using_command create' -l autotools -d 'Use template for Autotools-style build'
complete -f -c brew -n '__fish_brew_using_command create' -l no-fetch -d 'Don\'t download URL'
complete -f -c brew -n '__fish_brew_using_command create' -l set-name -d 'Override name autodetection'
complete -f -c brew -n '__fish_brew_using_command create' -l set-version -d 'Override version autodetection'
# desc
complete -f -c brew -n '__fish_brew_needs_command' -a desc -d "Summarize specified formulae in one line"
complete -f -c brew -n '__fish_brew_using_command desc' -l search -d 'Search names and descriptions'
complete -f -c brew -n '__fish_brew_using_command desc' -l name -d 'Search only names'
complete -f -c brew -n '__fish_brew_using_command desc' -l description -d 'Search only descriptions'
complete -f -c brew -n '__fish_brew_using_command desc' -a '(__fish_brew_formulae)'
# deps
complete -f -c brew -n '__fish_brew_needs_command' -a deps -d 'Show a formula\'s dependencies'
complete -f -c brew -n '__fish_brew_using_command deps' -l 1 -d 'Show only 1 level down'
complete -f -c brew -n '__fish_brew_using_command deps' -s n -d 'Show in topological order'
complete -f -c brew -n '__fish_brew_using_command deps' -l tree -d 'Show dependencies as tree'
complete -f -c brew -n '__fish_brew_using_command deps' -l all -d 'Show dependencies for all formulae'
complete -f -c brew -n '__fish_brew_using_command deps' -l installed -d 'Show dependencies for installed formulae'
complete -f -c brew -n '__fish_brew_using_command deps' -a '(__fish_brew_formulae)'
# diy
complete -f -c brew -n '__fish_brew_needs_command' -a 'diy configure' -d 'Determine installation prefix for non-brew software'
complete -f -c brew -n '__fish_brew_using_command diy' -l set-name -d 'Set name of package'
complete -f -c brew -n '__fish_brew_using_command diy' -l set-version -d 'Set version of package'
complete -f -c brew -n '__fish_brew_needs_command' -a 'doctor' -d 'Check your system for problems'
# edit
complete -f -c brew -n '__fish_brew_needs_command' -a 'edit' -d 'Open brew/formula for editing'
complete -f -c brew -n '__fish_brew_using_command edit' -a '(__fish_brew_formulae)'
# fetch
complete -f -c brew -n '__fish_brew_needs_command' -a fetch -d 'Download source for formula'
complete -f -c brew -n '__fish_brew_using_command fetch' -l force -d 'Remove a previously cached version and re-fetch'
complete -f -c brew -n '__fish_brew_using_command fetch' -l HEAD -d 'Download the HEAD version from a VCS'
complete -f -c brew -n '__fish_brew_using_command fetch' -l deps -d 'Also download dependencies'
complete -f -c brew -n '__fish_brew_using_command fetch' -s v -d 'Make HEAD checkout verbose'
complete -f -c brew -n '__fish_brew_using_command fetch' -l build-from-source -d 'Fetch source package instead of bottle'
complete -f -c brew -n '__fish_brew_using_command fetch' -a '(__fish_brew_formulae)'
complete -f -c brew -n '__fish_brew_needs_command' -a 'help' -d 'Display help'
# home
complete -f -c brew -n '__fish_brew_needs_command' -a home -d 'Open brew/formula\'s homepage'
complete -c brew -n '__fish_brew_using_command home' -a '(__fish_brew_formulae)'
# info
complete -f -c brew -n '__fish_brew_needs_command' -a 'info abv' -d 'Display information about formula'
complete -f -c brew -n '__fish_brew_using_command info' -l all -d 'Display info for all formulae'
complete -f -c brew -n '__fish_brew_using_command info' -l github -d 'Open the GitHub History page for formula'
complete -c brew -n '__fish_brew_using_command info' -a '(__fish_brew_formulae)'
# install
complete -f -c brew -n '__fish_brew_needs_command' -a 'install' -d 'Install formula'
complete -f -c brew -n '__fish_brew_using_command install' -l force -d 'Force install'
complete -f -c brew -n '__fish_brew_using_command install' -l debug -d 'If install fails, open shell in temp directory'
complete -f -c brew -n '__fish_brew_using_command install' -l ignore-dependencies -d 'skip installing any dependencies of any kind'
complete -f -c brew -n '__fish_brew_using_command install' -l cc -a "clang gcc-4.0 gcc-4.2 gcc-4.3 gcc-4.4 gcc-4.5 gcc-4.6 gcc-4.7 gcc-4.8 gcc-4.9 llvm-gcc" -d 'Attempt to compile using the specified compiler'
complete -f -c brew -n '__fish_brew_using_command install' -l build-from-source -d 'Compile from source even if a bottle is provided'
complete -f -c brew -n '__fish_brew_using_command install' -l devel -d 'Install the development version of formula'
complete -f -c brew -n '__fish_brew_using_command install' -l HEAD -d 'Install the HEAD version from VCS'
complete -f -c brew -n '__fish_brew_using_command install' -l interactive -d 'Download and patch formula, then open a shell'
complete -f -c brew -n '__fish_brew_using_command install' -l env -a "std super" -d 'Force the specified build environment'
complete -f -c brew -n '__fish_brew_using_command install' -l build-bottle -d 'Optimize for a generic CPU architecture'
complete -f -c brew -n '__fish_brew_using_command install' -l bottle-arch -a 'core core2 penryn g3 g4 g4e g5' -d 'Optimize for the specified CPU architecture'
complete -c brew -n '__fish_brew_using_command install' -a '(__fish_brew_formulae)'
# leaves
complete -f -c brew -n '__fish_brew_needs_command' -a 'leaves' -d 'List installed top level formulae'
complete -f -c brew -n '__fish_brew_using_command leaves' -a '(__fish_brew_leaves)'
# link
complete -f -c brew -n '__fish_brew_needs_command' -a 'link ln' -d 'Symlink installed formula'
complete -f -c brew -n '__fish_brew_using_command link' -l overwrite -d 'Overwrite existing files'
complete -f -c brew -n '__fish_brew_using_command ln' -l overwrite -d 'Overwrite existing files'
complete -f -c brew -n '__fish_brew_using_command link' -l dry-run -d 'Show what files would be linked or overwritten'
complete -f -c brew -n '__fish_brew_using_command ln' -l dry-run -d 'Show what files would be linked or overwritten'
complete -f -c brew -n '__fish_brew_using_command link' -l force -d 'Allow keg-only formulae to be linked'
complete -f -c brew -n '__fish_brew_using_command ln' -l force -d 'Allow keg-only formulae to be linked'
complete -f -c brew -n '__fish_brew_using_command link' -a '(__fish_brew_installed_formulas)'
complete -f -c brew -n '__fish_brew_using_command ln' -a '(__fish_brew_installed_formulas)'
# linkapps
complete -f -c brew -n '__fish_brew_needs_command' -a linkapps -d 'Symlink .app bundles into /Applications'
complete -f -c brew -n '__fish_brew_using_command linkapps' -l local -d 'Link .app bundles into ~/Applications instead'
# list
complete -f -c brew -n '__fish_brew_needs_command' -a 'list ls' -d 'List all installed formula'
complete -f -c brew -n '__fish_brew_using_command list' -l unbrewed -d 'List all files in the Homebrew prefix not installed by brew'
complete -f -c brew -n '__fish_brew_using_command list' -l versions -d 'Show the version number'
complete -f -c brew -n '__fish_brew_using_command list' -l pinned -d 'Show the versions of pinned formulae'
complete -c brew -n '__fish_brew_using_command list' -a '(__fish_brew_formulae)'
# ls
complete -f -c brew -n '__fish_brew_using_command ls' -l unbrewed -d 'List all files in the Homebrew prefix not installed by brew'
complete -f -c brew -n '__fish_brew_using_command ls' -l versions -d 'Show the version number'
complete -f -c brew -n '__fish_brew_using_command ls' -l pinned -d 'Show the versions of pinned formulae'
complete -c brew -n '__fish_brew_using_command ls' -a '(__fish_brew_formulae)'
# log
complete -f -c brew -n '__fish_brew_needs_command' -a log -d 'Show log for formula'
complete -c brew -n '__fish_brew_using_command log' -a '(__fish_brew_formulae)' -d 'formula'
# missing
complete -f -c brew -n '__fish_brew_needs_command' -a missing -d 'Check formula for missing dependencies'
complete -c brew -n '__fish_brew_using_command missing' -a '(__fish_brew_formulae)' -d 'formula'
# options
complete -f -c brew -n '__fish_brew_needs_command' -a options -d 'Display install options for formula'
complete -f -c brew -n '__fish_brew_using_command options' -l compact -d 'Show all options as a space-delimited list'
complete -f -c brew -n '__fish_brew_using_command options' -l all -d 'Show options for all formulae'
complete -f -c brew -n '__fish_brew_using_command options' -l installed -d 'Show options for all installed formulae'
complete -c brew -n '__fish_brew_using_command options' -a '(__fish_brew_formulae)' -d 'formula'
# outdated
complete -f -c brew -n '__fish_brew_needs_command' -a outdated -d 'Show formula that have updated versions'
complete -f -c brew -n '__fish_brew_using_command outdated' -l quiet -d 'Display only names'
# pin
complete -f -c brew -n '__fish_brew_needs_command' -a pin -d 'Pin the specified formulae to their current versions'
complete -f -c brew -n '__fish_brew_using_command pin' -a '(__fish_brew_installed_formulas)' -d 'formula'
# prune
complete -f -c brew -n '__fish_brew_needs_command' -a prune -d 'Remove dead symlinks'
# search
complete -f -c brew -n '__fish_brew_needs_command' -a 'search -S' -d 'Search for formula by name'
complete -f -c brew -n '__fish_brew_using_command search' -l macports -d 'Search on MacPorts'
complete -f -c brew -n '__fish_brew_using_command search' -l fink -d 'Search on Fink'
complete -f -c brew -n '__fish_brew_using_command -S' -l macports -d 'Search on MacPorts'
complete -f -c brew -n '__fish_brew_using_command -S' -l fink -d 'Search on Fink'
# services
complete -f -c brew -n '__fish_brew_needs_command' -a services -d 'Manage Homebrew services'
complete -f -c brew -n '__fish_brew_needs_services_action' -a cleanup -d 'Get rid of stale services and unused plist'
complete -f -c brew -n '__fish_brew_needs_services_action' -a list -d 'List all services managed by Homebrew'
complete -f -c brew -n '__fish_brew_needs_services_action' -a restart -d 'Gracefully restart a service'
complete -f -c brew -n '__fish_brew_needs_services_action' -a start -d 'Start a service'
complete -f -c brew -n '__fish_brew_needs_services_action' -a stop -d 'Stop a service'
complete -f -c brew -n '__fish_brew_is_subcommand_services restart start stop' -a '(__fish_brew_services)' -d 'formula'
complete -f -c brew -n '__fish_brew_is_subcommand_services restart start stop' -l all -d 'All Services'
# sh
complete -f -c brew -n '__fish_brew_needs_command' -a sh -d 'Instantiate a Homebrew build enviornment'
complete -f -c brew -n '__fish_brew_using_command sh' -l env=std -d 'Use stdenv instead of superenv'
# tap
complete -f -c brew -n '__fish_brew_needs_command' -a tap -d 'Tap a new formula repository on GitHub'
complete -f -c brew -n '__fish_brew_using_command tap' -l repair -d 'Create and prune tap symlinks as appropriate'
# test
complete -f -c brew -n '__fish_brew_needs_command' -a test -d 'Run tests for formula'
complete -f -c brew -n '__fish_brew_using_command test' -a '(__fish_brew_installed_formulas)' -d 'formula'
# uninstall
complete -f -c brew -n '__fish_brew_needs_command' -a 'uninstall remove rm' -d 'Uninstall formula'
complete -f -c brew -n '__fish_brew_using_command uninstall' -a '(__fish_brew_installed_formulas)'
complete -f -c brew -n '__fish_brew_using_command remove' -a '(__fish_brew_installed_formulas)'
complete -f -c brew -n '__fish_brew_using_command rm' -a '(__fish_brew_installed_formulas)'
complete -f -c brew -n '__fish_brew_using_command uninstall' -l force -d 'Delete all installed versions'
complete -f -c brew -n '__fish_brew_using_command remove' -l force -d 'Delete all installed versions'
complete -f -c brew -n '__fish_brew_using_command rm' -l force -d 'Delete all installed versions'
# unlink
complete -f -c brew -n '__fish_brew_needs_command' -a unlink -d 'Unlink formula'
complete -f -c brew -n '__fish_brew_using_command unlink' -a '(__fish_brew_installed_formulas)'
# unlinkapps
complete -f -c brew -n '__fish_brew_needs_command' -a unlinkapps -d 'Remove links created by brew linkapps'
complete -f -c brew -n '__fish_brew_using_command unlinkapps' -l local -d 'Remove links from ~/Applications created by brew linkapps'
# unpack
complete -f -c brew -n '__fish_brew_needs_command' -a unpack -d 'Extract source code'
complete -c brew -n '__fish_brew_using_command unpack' -a '(__fish_brew_formulae)'
# unpin
complete -f -c brew -n '__fish_brew_needs_command' -a unpin -d 'Unpin specified formulae'
complete -f -c brew -n '__fish_brew_using_command unpin' -a '(__fish_brew_pinned_formulas)'
# untap
complete -f -c brew -n '__fish_brew_needs_command' -a untap -d 'Remove a tapped repository'
complete -f -c brew -n '__fish_brew_using_command untap' -a '(__fish_brew_taps)'
# update
complete -f -c brew -n '__fish_brew_needs_command' -a update -d 'Fetch newest version of Homebrew and formulas'
complete -f -c brew -n '__fish_brew_using_command update' -l rebase -d 'Use git pull --rebase'
# update-reset
complete -f -c brew -n '__fish_brew_needs_command' -a update-reset -d 'Reset all Homebrew taps to upstream state'
# upgrade
complete -f -c brew -n '__fish_brew_needs_command' -a upgrade -d 'Upgrade outdated brews'
complete -f -c brew -n '__fish_brew_using_command upgrade' -a '(__fish_brew_outdated_formulas)'
# uses
complete -f -c brew -n '__fish_brew_needs_command' -a uses -d 'Show formulas that depend on specified formula'
complete -f -c brew -n '__fish_brew_using_command uses' -l installed -d 'List only installed formulae'
complete -f -c brew -n '__fish_brew_using_command uses' -l recursive -d 'Resolve more than one level of dependencies'
complete -c brew -n '__fish_brew_using_command uses' -a '(__fish_brew_formulae)'
#################
# brew switches #
#################
complete -f -c brew -n '__fish_brew_needs_command' -a '-v --version' -d 'Print version number of brew'
complete -f -c brew -n '__fish_brew_needs_command' -l env -x -d 'Show Homebrew a summary of the build environment'
complete -f -c brew -n '__fish_brew_needs_command' -l repository -x -d 'Display where Homebrew\'s .git directory is located'
complete -f -c brew -n '__fish_brew_needs_command' -l config -x -d 'Show Homebrew and system configuration'
# --prefix
complete -f -c brew -n '__fish_brew_needs_command' -l prefix -d 'Display Homebrew\'s install path'
complete -f -c brew -n '__fish_brew_using_command --prefix' -a '(__fish_brew_formulae)' -d 'Display formula\'s install path'
# --cache
complete -f -c brew -n '__fish_brew_needs_command' -l cache -d 'Display Homebrew\'s download cache'
complete -f -c brew -n '__fish_brew_needs_command' -n '__fish_brew_using_command --cache' -a '(__fish_brew_formulae)' -d 'Display the file or directory used to cache formula'
# --cellar
complete -f -c brew -n '__fish_brew_needs_command' -l cellar -d 'Display Homebrew\'s Cellar path'
complete -f -c brew -n '__fish_brew_using_command --cellar' -a '(__fish_brew_formulae)' -d 'Display formula\'s install path in Cellar'
######################
# brew cask commands #
#####################
# audit
complete -f -c brew -n '__fish_brew_needs_cask_action' -a audit -d 'Audit casks, add token to audit specific cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask audit' -a '(__fish_brew_casks)'
# cat
complete -f -c brew -n '__fish_brew_needs_cask_action' -a cat -d 'Display cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask cat' -a '(__fish_brew_casks)'
# cleanup
complete -f -c brew -n '__fish_brew_needs_cask_action' -a cleanup -d 'Cleans up cached downloads and tracker symlinks'
complete -f -c brew -n '__fish_brew_is_subcommand_cask cleanup' -l outdated -d 'Only clean cached downloads older than 10 days'
# create
complete -f -c brew -n '__fish_brew_needs_cask_action' -a create -d 'Create a new cask'
# doctor/dr
complete -f -c brew -n '__fish_brew_needs_cask_action' -a 'doctor dr' -d 'Checks for configuration issues'
# edit
complete -f -c brew -n '__fish_brew_needs_cask_action' -a edit -d 'Edit cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask edit' -a '(__fish_brew_casks)'
# fetch
complete -f -c brew -n '__fish_brew_needs_cask_action' -a fetch -d 'Fetch cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask fetch' -l force -d 'Force a redownload of cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask fetch' -a '(__fish_brew_casks)'
# home
complete -f -c brew -n '__fish_brew_needs_cask_action' -a 'home homepage' -d 'Open cask/cask\'s homepage'
complete -f -c brew -n '__fish_brew_is_subcommand_cask home' -a '(__fish_brew_casks)'
# homepage
complete -f -c brew -n '__fish_brew_is_subcommand_cask homepage' -a '(__fish_brew_casks_installed)'
# info
complete -f -c brew -n '__fish_brew_needs_cask_action' -a 'info abv' -d 'Dislay info about cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask info' -a '(__fish_brew_casks)'
# adv
complete -f -c brew -n '__fish_brew_is_subcommand_cask abv' -a '(__fish_brew_casks)'
# install
complete -f -c brew -n '__fish_brew_needs_cask_action' -a install -d 'Install cask indentified by token'
complete -f -c brew -n '__fish_brew_is_subcommand_cask install' -l force -d 'Force install of cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask install' -l require-sha -d 'Require SHA, fails otherwise'
complete -f -c brew -n '__fish_brew_is_subcommand_cask install' -l skip-cask-deps -d 'Skip any cask dependencies'
complete -c brew -n '__fish_brew_is_subcommand_cask install' -a '(__fish_brew_casks)'
# list
complete -f -c brew -n '__fish_brew_needs_cask_action' -a 'list ls' -d 'List installed casks'
complete -f -c brew -n '__fish_brew_is_subcommand_cask list' -s 1 -d 'Format output as a single column'
complete -f -c brew -n '__fish_brew_is_subcommand_cask list' -l versions -d 'Show all installed versions'
complete -f -c brew -n '__fish_brew_is_subcommand_cask list' -a '(__fish_brew_casks_installed)' -d 'List staged files'
# ls
complete -f -c brew -n '__fish_brew_is_subcommand_cask ls' -s 1 -d 'Format output as a single column'
complete -f -c brew -n '__fish_brew_is_subcommand_cask ls' -l versions -d 'Show all installed versions'
complete -f -c brew -n '__fish_brew_is_subcommand_cask ls' -a '(__fish_brew_casks_installed)' -d 'List staged files'
# outdated
complete -f -c brew -n '__fish_brew_needs_cask_action' -a outdated -d 'List outdated casks'
complete -f -c brew -n '__fish_brew_is_subcommand_cask outdated' -l greedy -d 'Include casks having auto_updates true or version :latest'
complete -f -c brew -n '__fish_brew_is_subcommand_cask outdated' -l quiet -d 'Suppresses the display of versions'
complete -f -c brew -n '__fish_brew_is_subcommand_cask outdated' -l verbose -d 'Forces the display of the outdated and latest version'
complete -f -c brew -n '__fish_brew_is_subcommand_cask outdated' -a '(__fish_brew_casks_installed)'
# reinstall
complete -f -c brew -n '__fish_brew_needs_cask_action' -a reinstall -d 'Reinstall cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask reinstall' -a '(__fish_brew_casks_installed)'
# search
complete -f -c brew -n '__fish_brew_needs_cask_action' -a 'search -S' -d 'Search all known casks. RexEx by delimiting using /regex/'
# style
complete -f -c brew -n '__fish_brew_needs_cask_action' -a style -d 'Check all or the given casks for correct style using RuboCop'
complete -f -c brew -n '__fish_brew_is_subcommand_cask style' -l fix -d 'Auto-correct any style errors if possible'
complete -f -c brew -n '__fish_brew_is_subcommand_cask style' -a '(__fish_brew_casks)'
# uninstall
complete -f -c brew -n '__fish_brew_needs_cask_action' -a 'remove rm uninstall' -d 'Uninstall cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask uninstall' -l force -d 'Force the uninstall'
complete -f -c brew -n '__fish_brew_is_subcommand_cask uninstall' -a '(__fish_brew_casks_installed)'
# remove
complete -f -c brew -n '__fish_brew_is_subcommand_cask remove' -l force -d 'Force the uninstall'
complete -f -c brew -n '__fish_brew_is_subcommand_cask remove' -a '(__fish_brew_casks_installed)'
# rm
complete -f -c brew -n '__fish_brew_is_subcommand_cask rm' -l force -d 'Force the uninstall'
complete -f -c brew -n '__fish_brew_is_subcommand_cask rm' -a '(__fish_brew_casks_installed)'
# upgrade
complete -f -c brew -n '__fish_brew_needs_cask_action' -a upgrade -d 'Upgrade all or given cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask upgrade' -l force -d 'Force upgrade'
complete -f -c brew -n '__fish_brew_is_subcommand_cask upgrade' -l greedy -d 'Include casks having auto_updates true or version :latest'
complete -f -c brew -n '__fish_brew_is_subcommand_cask upgrade' -a '(__fish_brew_casks_installed)'
# zap
complete -f -c brew -n '__fish_brew_needs_cask_action' -a zap -d 'Unconditionally remove all files associated with the given Cask'
complete -f -c brew -n '__fish_brew_is_subcommand_cask zap' -a '(__fish_brew_casks_installed)'
######################
# brew cask switches #
######################
# version
complete -f -c brew -n '__fish_brew_needs_cask_action' -a --version -d 'Print version number of Caskroom'
# Completions for brew are maintained upstream.
# They should be installed with brew,
# and PRs should be directed to https://github.com/Homebrew/brew/blob/master/completions/fish/brew.fish.

View File

@@ -0,0 +1,428 @@
# Completions for btrfs-progs
# Todo:
# - (Done) Detailed options per command
# - Simplified duplicate options completion with `for`
# - Simplified descriptions
# Filter the completions per primary command
function __btrfs_commands
if not set -q argv[1]
return 1
end
set -l cmd (commandline -cp)
if string match -qr -- "btrfs\s+$argv[1]\s+\S*" $cmd
return 0
end
return 1
end
# Filter the completions per command group
function __btrfs_command_groups
if not set -q argv[1]
return 1
end
set -l cmd (commandline -cp)
if set -q argv[2]
if string match -qr -- "btrfs\s+$argv[1]\s+$argv[2]\s+\S*" $cmd
return 0
end
return 1
end
if string match -qr -- "btrfs\s+$argv[1]\s+\S*\$" $cmd
return 0
end
return 1
end
set -l check '__btrfs_commands check'
set -l restore '__btrfs_commands restore'
set -l send '__btrfs_commands send'
set -l receive '__btrfs_commands receive'
set -l help '__btrfs_commands help'
set -l subvolume '__btrfs_command_groups subvolume'
set -l filesystem '__btrfs_command_groups filesystem'
set -l balance '__btrfs_command_groups balance'
set -l device '__btrfs_command_groups device'
set -l scrub '__btrfs_command_groups scrub'
set -l rescue '__btrfs_command_groups rescue'
set -l inspect_internal '__btrfs_command_groups inspect-internal'
set -l property '__btrfs_command_groups property'
set -l quota '__btrfs_command_groups quota'
set -l qgroup '__btrfs_command_groups qgroup'
set -l replace '__btrfs_command_groups replace'
# Global command
complete -f -c btrfs -l help -d 'Display help information'
# Primary command
complete -f -c btrfs -n '__fish_is_first_arg' -a check -d 'Check structural integrity of a filesystem (unmounted).'
complete -f -c btrfs -n '__fish_is_first_arg' -a restore -d 'Try to restore files from a damaged filesystem (unmounted)'
complete -f -c btrfs -n '__fish_is_first_arg' -a send -d 'Send the subvolume(s) to stdout.'
complete -f -c btrfs -n '__fish_is_first_arg' -a receive -d 'Receive subvolumes from a stream'
complete -f -c btrfs -n '__fish_is_first_arg' -a help -d 'Display help information'
complete -f -c btrfs -n '__fish_is_first_arg' -a version -d 'Display btrfs-progs version'
# Primary command groups
complete -f -c btrfs -n '__fish_is_first_arg' -a subvolume -d 'manage subvolumes: create, delete, list, etc'
complete -f -c btrfs -n '__fish_is_first_arg' -a filesystem -d 'overall filesystem tasks and information'
complete -f -c btrfs -n '__fish_is_first_arg' -a balance -d 'balance data across devices, or change block groups using filters'
complete -f -c btrfs -n '__fish_is_first_arg' -a device -d 'manage and query devices in the filesystem'
complete -f -c btrfs -n '__fish_is_first_arg' -a scrub -d 'verify checksums of data and metadata'
complete -f -c btrfs -n '__fish_is_first_arg' -a rescue -d 'toolbox for specific rescue operations'
complete -f -c btrfs -n '__fish_is_first_arg' -a inspect-internal -d 'query various internal information'
complete -f -c btrfs -n '__fish_is_first_arg' -a property -d 'modify properties of filesystem objects'
complete -f -c btrfs -n '__fish_is_first_arg' -a quota -d 'manage filesystem quota settings'
complete -f -c btrfs -n '__fish_is_first_arg' -a qgroup -d 'manage quota groups'
complete -f -c btrfs -n '__fish_is_first_arg' -a replace -d 'replace a device in the filesystem'
# btrfs check
complete -f -c btrfs -n $check -s s -l super -d 'Use this SUPERBLOCK copy'
complete -f -c btrfs -n $check -s b -l backup -d 'Use the first valid BACKUP root copy'
complete -f -c btrfs -n $check -s r -l tree-root -d 'Use the given bytenr for the TREE root'
complete -f -c btrfs -n $check -l chunk-root -d 'Use the given bytenr for the CHUNK-TREE root'
complete -f -c btrfs -n $check -l readonly -d 'Run in read-only mode'
complete -f -c btrfs -n $check -l repair -d 'Try to repair the filesystem'
complete -f -c btrfs -n $check -l force -d 'Skip mount checks, repair is not possible'
complete -f -c btrfs -n $check -l mode -d 'Allows choice of memory/IO trade-offs' -ra '{original,lowmem}'
complete -f -c btrfs -n $check -l init-csum-tree -d 'Create a new CRC tree (repair only)'
complete -f -c btrfs -n $check -l init-extent-tree -d 'Create a new extent tree (repair only)'
complete -f -c btrfs -n $check -l clear-space-cache -d 'clear space cache (repair only)' -ra '{v1,v2}'
complete -f -c btrfs -n $check -l check-data-csum -d 'Verify checksums of data blocks'
complete -f -c btrfs -n $check -s Q -l qgroup-report -d 'Print a report on qgroup consistency'
complete -f -c btrfs -n $check -s E -l subvol-extents -d 'Print subvolume extents and sharing state'
complete -f -c btrfs -n $check -s p -l progress -d 'Indicate progress'
# btrfs restore
complete -f -c btrfs -n $restore -s s -l snapshots -d 'Get snapshots'
complete -f -c btrfs -n $restore -s x -l xattr -d 'Restore extended attributes'
complete -f -c btrfs -n $restore -s m -l metadata -d 'Restore owner, mode and times'
complete -f -c btrfs -n $restore -s S -l symlink -d 'Restore symbolic links'
complete -f -c btrfs -n $restore -s v -l verbose -d 'Verbose'
complete -f -c btrfs -n $restore -s i -l ignore-errors -d 'Ignore errors'
complete -f -c btrfs -n $restore -s o -l overwrite -d 'Overwrite'
complete -f -c btrfs -n $restore -s t -d 'Tree location'
complete -f -c btrfs -n $restore -s f -d 'Filesystem location'
complete -f -c btrfs -n $restore -s u -l super -d 'Super mirror'
complete -f -c btrfs -n $restore -s r -l root -d 'Root objectid'
complete -f -c btrfs -n $restore -s d -d 'Find dir'
complete -f -c btrfs -n $restore -s l -l list-roots -d 'List tree roots'
complete -f -c btrfs -n $restore -s D -l dry-run -d 'Only list files that would be recovered'
complete -f -c btrfs -n $restore -l path-regex -d 'Restore only filenames matching regex'
complete -f -c btrfs -n $restore -s c -d 'Ignore case (--path-regex only)'
# btrfs send
complete -f -c btrfs -n $send -s e -d ''
complete -f -c btrfs -n $send -s p -d 'Send an incremental stream from <parent> to <subvol>'
complete -f -c btrfs -n $send -s c -d 'Use this snapshot as a clone source for an incremental send'
complete -f -c btrfs -n $send -s f -d 'Output is normally written to stdout'
complete -f -c btrfs -n $send -l no-data -d 'send in NO_FILE_DATA mode'
complete -f -c btrfs -n $send -s v -l verbose -d 'Enable verbose output to stderr'
complete -f -c btrfs -n $send -s q -l quiet -d 'Suppress all messages, except errors'
# btrfs receive
complete -f -c btrfs -n $receive -s v -d 'Increase verbosity about performed actions'
complete -f -c btrfs -n $receive -s q -l quiet -d 'Suppress all messages, except errors'
complete -f -c btrfs -n $receive -s f -d 'Read the stream from FILE instead of stdin'
complete -f -c btrfs -n $receive -s e -d 'Terminate after receiving an <end cmd> marker in the stream'
complete -f -c btrfs -n $receive -s C -l chroot -d 'Confine the process to <mount> using chroot'
complete -f -c btrfs -n $receive -s E -l max-errors -d 'Terminate when NUMBER errors occur'
complete -f -c btrfs -n $receive -s m -d 'The root mount point of the destination filesystem'
complete -f -c btrfs -n $receive -l dump -d 'Dump stream metadata'
# btrfs help
complete -f -c btrfs -n $help -l full -d 'Display detailed help on every command'
complete -f -c btrfs -n $help -l box -d 'Show list of built-in tools (busybox style)'
# btrfs subvolume
complete -f -c btrfs -n $subvolume -a create -d 'Create a subvolume'
complete -f -c btrfs -n $subvolume -a delete -d 'Delete subvolume(s)'
complete -f -c btrfs -n $subvolume -a list -d 'List subvolumes and snapshots in the filesystem.'
complete -f -c btrfs -n $subvolume -a snapshot -d 'Create a snapshot of the subvolume'
complete -f -c btrfs -n $subvolume -a get-default -d 'Get the default subvolume of a filesystem'
complete -f -c btrfs -n $subvolume -a set-default -d 'Set the default subvolume of the filesystem mounted as default.'
complete -f -c btrfs -n $subvolume -a find-new -d 'List the recently modified files in a filesystem'
complete -f -c btrfs -n $subvolume -a show -d 'Show more information about the subvolume'
complete -f -c btrfs -n $subvolume -a sync -d 'Wait until given subvolume(s) are completely removed from the filesystem.'
# btrfs subvolume create
complete -f -c btrfs -n '__btrfs_command_groups subvolume create' -s i -d 'Add subvolume to a qgroup (can be given multiple times)'
# btrfs subvolume delete
complete -f -c btrfs -n '__btrfs_command_groups subvolume delete' -s c -l commit-after -d 'Wait for transaction commit at the end of the operation'
complete -f -c btrfs -n '__btrfs_command_groups subvolume delete' -s C -l commit-each -d 'Wait for transaction commit after deleting each subvolume'
complete -f -c btrfs -n '__btrfs_command_groups subvolume delete' -s v -l verbose -d 'Verbose output of operations'
# btrfs subvolume list
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s o -d 'Print only subvolumes below specified path'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s a -d 'Print all the subvolumes and absolute and relative path'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s p -d 'Print parent ID'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s c -d 'Print the ogeneration of the subvolume'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s g -d 'Print the generation of the subvolume'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s u -d 'Print the uuid of subvolumes (and snapshots)'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s q -d 'Print the parent uuid of the snapshots'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s R -d 'Print the uuid of the received snapshots'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s s -d 'List only snapshots'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s r -d 'List readonly subvolumes (including snapshots)'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s d -d 'List deleted subvolumes that are not yet cleaned'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s t -d 'Print the result as a table'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s G -d 'Filter the subvolumes by generation'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -s C -d 'Filter the subvolumes by ogeneration'
complete -f -c btrfs -n '__btrfs_command_groups subvolume list' -l sort -d 'List the subvolume in order' -a '{gen,ogen,rootid,path}'
# btrfs subvolume snapshot
complete -f -c btrfs -n '__btrfs_command_groups subvolume snapshot' -s r -d 'Create a readonly snapshot'
complete -f -c btrfs -n '__btrfs_command_groups subvolume snapshot' -s i -d 'Add snapshot to a qgroup (can be given multiple times)'
# btrfs subvolume show
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s r -l rootid -d 'Show rootid of the subvolume'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s u -l uuid -d 'Show uuid of the subvolume'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s b -l raw -d 'Show raw numbers in bytes'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s h -l human-readable -d 'Show human friendly numbers, base 1024'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s H -d 'Show human friendly numbers, base 1000'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s k -l kbytes -d 'Show sizes in KiB, or kB with --si'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s m -l mbytes -d 'Show sizes in MiB, or MB with --si'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s g -l gbytes -d 'Show sizes in GiB, or GB with --si'
complete -f -c btrfs -n '__btrfs_command_groups subvolume show' -s t -l tbytes -d 'Show sizes in TiB, or TB with --si'
# btrfs subvolume sync
complete -f -c btrfs -n '__btrfs_command_groups subvolume sync' -s s -d 'Sleep NUMBER seconds between checks'
# btrfs filesystem
complete -f -c btrfs -n $filesystem -a df -d 'Show space usage information for a mount point'
complete -f -c btrfs -n $filesystem -a du -d 'Summarize disk usage of each file.'
complete -f -c btrfs -n $filesystem -a show -d 'Show the structure of a filesystem'
complete -f -c btrfs -n $filesystem -a sync -d 'Force a sync on a filesystem'
complete -f -c btrfs -n $filesystem -a defragment -d 'Defragment a file or a directory'
complete -f -c btrfs -n $filesystem -a resize -d 'Resize a filesystem'
complete -f -c btrfs -n $filesystem -a label -d 'Get or change the label of a filesystem'
complete -f -c btrfs -n $filesystem -a usage -d 'Show detailed information about internal filesystem usage.'
# btrfs filesystem df
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s b -l raw -d 'Show raw numbers in bytes'
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s h -l human-readable -d 'Show human friendly numbers, base 1024'
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s H -d 'Show human friendly numbers, base 1000'
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s k -l kbytes -d 'Show sizes in KiB, or kB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s m -l mbytes -d 'Show sizes in MiB, or MB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s g -l gbytes -d 'Show sizes in GiB, or GB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem df' -s t -l tbytes -d 'Show sizes in TiB, or TB with --si'
# btrfs filesystem du
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -s s -l summarize -d 'Display only a total for each argument'
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -l raw -d 'Show raw numbers in bytes'
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -l human-readable -d 'Show human friendly numbers, base 1024'
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -l kbytes -d 'Show sizes in KiB, or kB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -l mbytes -d 'Show sizes in MiB, or MB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -l gbytes -d 'Show sizes in GiB, or GB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem du' -l tbytes -d 'Show sizes in TiB, or TB with --si'
# btrfs filesystem show
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -s d -l all-devices -d 'Show only disks under /dev containing btrfs filesystem'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -s m -l mounted -d 'Show only mounted btrfs'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -l raw -d 'Show raw numbers in bytes'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -l human-readable -d 'Show human friendly numbers, base 1024'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -l kbytes -d 'Show sizes in KiB, or kB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -l mbytes -d 'Show sizes in MiB, or MB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -l gbytes -d 'Show sizes in GiB, or GB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem show' -l tbytes -d 'Show sizes in TiB, or TB with --si'
# btrfs filesystem defragment
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s v -d 'Be verbose'
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s r -d 'Defragment files recursively'
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s c -d 'Compress the file while defragmenting' -ra '{zlib,lzo,zstd}'
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s f -d 'Flush data to disk immediately after defragmenting'
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s s -d 'Defragment only from NUMBER byte onward'
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s l -d 'Defragment only up to LEN bytes'
complete -f -c btrfs -n '__btrfs_command_groups filesystem defragment' -s t -d 'Target extent SIZE hint'
# btrfs filesystem usage
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s b -l raw -d 'Show raw numbers in bytes'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s h -l human-readable -d 'Show human friendly numbers, base 1024'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s H -d 'Show human friendly numbers, base 1000'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s k -l kbytes -d 'Show sizes in KiB, or kB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s m -l mbytes -d 'Show sizes in MiB, or MB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s g -l gbytes -d 'Show sizes in GiB, or GB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s t -l tbytes -d 'Show sizes in TiB, or TB with --si'
complete -f -c btrfs -n '__btrfs_command_groups filesystem usage' -s T -d 'Show data in tabular format'
# btrfs balance
complete -f -c btrfs -n $balance -a start -d 'Balance chunks across the devices'
complete -f -c btrfs -n $balance -a pause -d 'Pause running balance'
complete -f -c btrfs -n $balance -a cancel -d 'Cancel running or paused balance'
complete -f -c btrfs -n $balance -a resume -d 'Resume interrupted balance'
complete -f -c btrfs -n $balance -a status -d 'Show status of running or paused balance'
# btrfs balance start
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s d -d 'Act on data chunks with FILTERS'
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s m -d 'Act on metadata chunks with FILTERS'
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s s -d 'Act on system chunks with FILTERS (only under -f)'
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s v -d 'Be verbose'
complete -f -c btrfs -n '__btrfs_command_groups balance start' -s f -d 'Force a reduction of metadata integrity'
complete -f -c btrfs -n '__btrfs_command_groups balance start' -l full-balance -d 'Do not print warning and do not delay start'
complete -f -c btrfs -n '__btrfs_command_groups balance start' -l background -l bg -d 'Run the balance as a background process'
# btrfs balance status
complete -f -c btrfs -n '__btrfs_command_groups balance status' -s v -d 'Be verbose'
# btrfs device
complete -f -c btrfs -n $device -a add -d 'Add one or more devices to a mounted filesystem.'
complete -f -c btrfs -n $device -a delete -d 'Remove a device from a filesystem'
complete -f -c btrfs -n $device -a remove -d 'Remove a device from a filesystem'
complete -f -c btrfs -n $device -a scan -d 'Scan or forget (unregister) devices of btrfs filesystems'
complete -f -c btrfs -n $device -a ready -d 'Check and wait until a group of devices of a filesystem is ready for mount'
complete -f -c btrfs -n $device -a stats -d 'Show device IO error statistics'
complete -f -c btrfs -n $device -a usage -d 'Show detailed information about internal allocations in devices.'
# btrfs device add
complete -f -c btrfs -n '__btrfs_command_groups device add' -s K -l nodiscard -d 'Do not perform TRIM on DEVICES'
complete -f -c btrfs -n '__btrfs_command_groups device add' -s f -l force -d 'Force overwrite existing filesystem on the disk'
# btrfs device scan
complete -f -c btrfs -n '__btrfs_command_groups device scan' -s d -l all-devices -d 'Enumerate and register all devices'
complete -f -c btrfs -n '__btrfs_command_groups device scan' -s u -l forget -d 'Unregister a given device or all stale devices'
# btrfs device stats
complete -f -c btrfs -n '__btrfs_command_groups device stats' -s c -l check -d 'Return non-zero if any stat counter is not zero'
complete -f -c btrfs -n '__btrfs_command_groups device stats' -s z -l reset -d 'Show current stats and reset values to zero'
# btrfs device usage
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s b -l raw -d 'Show raw numbers in bytes'
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s h -l human-readable -d 'Show human friendly numbers, base 1024'
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s H -d 'Show human friendly numbers, base 1000'
complete -f -c btrfs -n '__btrfs_command_groups device usage' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
complete -f -c btrfs -n '__btrfs_command_groups device usage' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s k -l kbytes -d 'Show sizes in KiB, or kB with --si'
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s m -l mbytes -d 'Show sizes in MiB, or MB with --si'
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s g -l gbytes -d 'Show sizes in GiB, or GB with --si'
complete -f -c btrfs -n '__btrfs_command_groups device usage' -s t -l tbytes -d 'Show sizes in TiB, or TB with --si'
# btrfs scrub
complete -f -c btrfs -n $scrub -a start -d 'Start a new scrub. If a scrub is already running, the new one fails.'
complete -f -c btrfs -n $scrub -a cancel -d 'Cancel a running scrub'
complete -f -c btrfs -n $scrub -a resume -d 'Resume previously canceled or interrupted scrub'
complete -f -c btrfs -n $scrub -a status -d 'Show status of running or finished scrub'
# btrfs scrub start
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s B -d 'Do not background'
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s d -d 'Stats per device (-B only)'
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s q -d 'Be quiet'
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s r -d 'Read only mode'
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s R -d 'Raw print mode, print full data instead of summary'
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s c -d 'Set ioprio class (see ionice(1) manpage)'
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s n -d 'Set ioprio classdata (see ionice(1) manpage)'
complete -f -c btrfs -n '__btrfs_command_groups scrub start' -s f -d 'Force starting new scrub'
# btrfs scrub resume
complete -f -c btrfs -n '__btrfs_command_groups scrub resume' -s B -d 'Do not background'
complete -f -c btrfs -n '__btrfs_command_groups scrub resume' -s d -d 'Stats per device (-B only)'
complete -f -c btrfs -n '__btrfs_command_groups scrub resume' -s q -d 'Be quiet'
complete -f -c btrfs -n '__btrfs_command_groups scrub resume' -s r -d 'Read only mode'
complete -f -c btrfs -n '__btrfs_command_groups scrub resume' -s R -d 'Raw print mode, print full data instead of summary'
complete -f -c btrfs -n '__btrfs_command_groups scrub resume' -s c -d 'Set ioprio class (see ionice(1) manpage)'
complete -f -c btrfs -n '__btrfs_command_groups scrub resume' -s n -d 'Set ioprio classdata (see ionice(1) manpage)'
# btrfs scrub status
complete -f -c btrfs -n '__btrfs_command_groups scrub status' -s d -d 'Stats per DEVICE'
complete -f -c btrfs -n '__btrfs_command_groups scrub status' -s R -d 'Print raw stats'
# btrfs rescue
complete -f -c btrfs -n $rescue -a chunk-recover -d 'Recover the chunk tree by scanning the devices one by one.'
complete -f -c btrfs -n $rescue -a super-recover -d 'Recover bad superblocks from good copies'
complete -f -c btrfs -n $rescue -a zero-log -d 'Clear the tree log. Usable if it\'s corrupted and prevents mount.'
complete -f -c btrfs -n $rescue -a fix-device-size -d 'Re-align device and super block sizes. Usable if newer kernel refuse to mount it due to mismatch super size'
# btrfs rescue chunk-recover
complete -f -c btrfs -n '__btrfs_command_groups rescue chunk-recover' -s y -d 'Assume an answer of YES to all questions'
complete -f -c btrfs -n '__btrfs_command_groups rescue chunk-recover' -s v -d 'Verbose mode'
# btrfs rescue super-recover
complete -f -c btrfs -n '__btrfs_command_groups rescue super-recover' -s y -d 'Assume an answer of YES to all questions'
complete -f -c btrfs -n '__btrfs_command_groups rescue super-recover' -s v -d 'Verbose mode'
# btrfs inspect-internal
complete -f -c btrfs -n $inspect_internal -a inode-resolve -d 'Get file system paths for the given inode'
complete -f -c btrfs -n $inspect_internal -a logical-resolve -d 'Get file system paths for the given logical address'
complete -f -c btrfs -n $inspect_internal -a subvolid-resolve -d 'Get file system paths for the given subvolume ID.'
complete -f -c btrfs -n $inspect_internal -a rootid -d 'Get tree ID of the containing subvolume of path.'
complete -f -c btrfs -n $inspect_internal -a min-dev-size -d 'Get the minimum size the device can be shrunk to. The device id 1 is used by default.'
complete -f -c btrfs -n $inspect_internal -a dump-tree -d 'Dump tree structures from a given device'
complete -f -c btrfs -n $inspect_internal -a dump-super -d 'Dump superblock from a device in a textual form'
complete -f -c btrfs -n $inspect_internal -a tree-stats -d 'Print various stats for trees'
# btrfs inspect-internal inode-resolve
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal inode-resolve' -s v -d 'Verbose mode'
# btrfs inspect-internal logical-resolve
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal logical-resolve' -s P -d 'Skip the path resolving and print the inodes instead'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal logical-resolve' -s v -d 'Verbose mode'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal logical-resolve' -s s -d 'Set inode container\'s SIZE'
# btrfs inspect-internal min-dev-size
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal min-dev-size' -l id -d 'Specify the DEVICE-ID to query'
# btrfs inspect-internal dump-tree
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s e -l extents -d 'Print only extent info: extent and device trees'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s d -l device -d 'Print only device info: tree root, chunk and device trees'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s r -l roots -d 'Print only short root node info'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s R -l backups -d 'Print short root node info and backup root info'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s u -l uuid -d 'Print only the uuid tree'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s b -l block -d 'Print info from the specified BLOCK only'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -s t -l tree -d 'Print only tree with the given ID'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l follow -d 'Use with -b, to show all children tree blocks of <block_num>'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l noscan -d 'Do not scan the devices from the filesystem'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l bfs -d 'Breadth-first traversal of the trees, print nodes, then leaves'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-tree' -l dfs -d 'Depth-first traversal of the trees'
# btrfs inspect-internal dump-super
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -s f -l full -d 'Print full superblock information, backup roots etc.'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -s a -l all -d 'Print information about all superblocks'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -s s -l super -d 'Specify which SUPER-BLOCK copy to print out' -ra '{0,1,2}'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -s F -l force -d 'Attempt to dump superblocks with bad magic'
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal dump-super' -l bytenr -d 'Specify alternate superblock OFFSET'
# btrfs inspect-internal tree-stats
complete -f -c btrfs -n '__btrfs_command_groups inspect-internal tree-stats' -s b -d 'Show raw numbers in bytes'
# btrfs property
complete -f -c btrfs -n $property -a get -d 'Get a property value of a btrfs object'
complete -f -c btrfs -n $property -a set -d 'Set a property on a btrfs object'
complete -f -c btrfs -n $property -a list -d 'Lists available properties with their descriptions for the given object'
# btrfs property get
complete -f -c btrfs -n '__btrfs_command_groups property get' -s t -d 'List properties for the given object type' -ra '{inode,subvol,filesystem,device}'
# btrfs property set
complete -f -c btrfs -n '__btrfs_command_groups property set' -s t -d 'List properties for the given object type' -ra '{inode,subvol,filesystem,device}'
# btrfs property list
complete -f -c btrfs -n '__btrfs_command_groups property list' -s t -d 'List properties for the given object type' -ra '{inode,subvol,filesystem,device}'
# btrfs quota
complete -f -c btrfs -n $quota -a enable -d 'Enable subvolume quota support for a filesystem.'
complete -f -c btrfs -n $quota -a disable -d 'Disable subvolume quota support for a filesystem.'
complete -f -c btrfs -n $quota -a rescan -d 'Trash all qgroup numbers and scan the metadata again with the current config.'
# btrfs quota rescan
complete -f -c btrfs -n '__btrfs_command_groups quota rescan' -s s -d 'Show status of a running rescan operation'
complete -f -c btrfs -n '__btrfs_command_groups quota rescan' -s w -d 'Wait for rescan operation to finish'
# btrfs qgroup
complete -f -c btrfs -n $qgroup -a assign -d 'Assign SRC as the child qgroup of DST'
complete -f -c btrfs -n $qgroup -a remove -d 'Remove a child qgroup SRC from DST.'
complete -f -c btrfs -n $qgroup -a create -d 'Create a subvolume quota group.'
complete -f -c btrfs -n $qgroup -a destroy -d 'Destroy a quota group.'
complete -f -c btrfs -n $qgroup -a show -d 'Show subvolume quota groups.'
complete -f -c btrfs -n $qgroup -a limit -d 'Set the limits a subvolume quota group.'
# btrfs qgroup assign
complete -f -c btrfs -n '__btrfs_command_groups qgroup assign' -l rescan -d 'Schedule qutoa rescan if needed'
complete -f -c btrfs -n '__btrfs_command_groups qgroup assign' -l no-rescan -d 'Don\'t schedule quota rescan'
# btrfs qgroup show
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -s p -d 'Print parent qgroup id'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -s c -d 'Print child qgroup id'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -s r -d 'Print limit of referenced size of qgroup'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -s e -d 'Print limit of exclusive size of qgroup'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -s F -d 'List all qgroups including ancestral qgroups'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -s f -d 'List all qgroups excluding ancestral qgroups'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l raw -d 'Show raw numbers in bytes'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l human-readable -d 'Show human friendly numbers, base 1024'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l iec -d 'Use 1024 as a base (KiB, MiB, GiB, TiB)'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l si -d 'Use 1000 as a base (kB, MB, GB, TB)'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l kbytes -d 'Show sizes in KiB, or kB with --si'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l mbytes -d 'Show sizes in MiB, or MB with --si'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l gbytes -d 'Show sizes in GiB, or GB with --si'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l tbytes -d 'Show sizes in TiB, or TB with --si'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l sort -d 'List qgroups sorted by specified items' -a '{qgroupid,rfer,excl,max_rfer,max_excl}'
complete -f -c btrfs -n '__btrfs_command_groups qgroup show' -l sync -d 'Force sync of the filesystem before getting info'
# btrfs qgroup limit
complete -f -c btrfs -n '__btrfs_command_groups qgroup limit' -s c -d 'Limit amount of data after compression'
complete -f -c btrfs -n '__btrfs_command_groups qgroup limit' -s e -d 'Limit space exclusively assigned to this qgroup'
# btrfs replace
complete -f -c btrfs -n $replace -a start -d 'Replace device of a btrfs filesystem.'
complete -f -c btrfs -n $replace -a status -d 'Print status and progress information of a running device replace'
complete -f -c btrfs -n $replace -a cancel -d 'Cancel a running device replace operation.'
# btrfs replace start
complete -f -c btrfs -n '__btrfs_command_groups replace start' -s r -d 'Only read from <srcdev> if no other zero-defect mirror exists'
complete -f -c btrfs -n '__btrfs_command_groups replace start' -s f -d 'Force using and overwriting <targetdev>'
complete -f -c btrfs -n '__btrfs_command_groups replace start' -s B -d 'Do not background'
# btrfs replace status
complete -f -c btrfs -n '__btrfs_command_groups replace status' -s 1 -d 'Only print once until the replace operation finishes'

View File

@@ -1,5 +1,4 @@
complete -c builtin -s h -l help -d 'Display help and exit'
complete -c builtin -s n -l names -d 'Print names of all existing builtins'
complete -c builtin -xa '(builtin -n)'
complete -c builtin -n '__fish_use_subcommand' -xa '__fish_complete_subcommand'
complete -c builtin -n 'test (count (commandline -opc)) -eq 1' -s h -l help -d 'Display help and exit'
complete -c builtin -n 'test (count (commandline -opc)) -eq 1' -s n -l names -d 'Print names of all existing builtins'
complete -c builtin -n 'test (count (commandline -opc)) -eq 1' -xa '(builtin -n)'
complete -c builtin -n 'test (count (commandline -opc)) -ge 2' -xa '(__fish_complete_subcommand)'

View File

@@ -1,25 +1,25 @@
# Completion for bundler
function __fish_bundle_no_command -d 'Test if bundle has been given no subcommand'
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 ]
return 0
end
return 1
end
function __fish_bundle_using_command -d 'Test if bundle has been given a specific subcommand'
set cmd (commandline -opc)
if [ (count $cmd) -gt 1 ]
if [ $argv[1] = $cmd[2] ]
return 0
set cmd (commandline -opc)
if [ (count $cmd) -gt 1 ]
if [ $argv[1] = $cmd[2] ]
return 0
end
end
end
return 1
return 1
end
function __fish_bundled_gems
bundle list | sed '1 d' | sed -e 's/\*//g' -e 's/(.*)//g' -e 's/^ *//g' -e 's/ *$//g'
bundle list | sed '1 d' | sed -e 's/\*//g' -e 's/(.*)//g' -e 's/^ *//g' -e 's/ *$//g'
end
# Options for all commands
@@ -47,7 +47,7 @@ complete -f -n '__fish_bundle_using_command install' -c bundle -l binstubs -d 'C
complete -f -n '__fish_bundle_using_command install' -c bundle -l shebang -d 'Specify a ruby executable to use with generated binstubs'
complete -f -n '__fish_bundle_using_command install' -c bundle -l standalone -d 'Make a bundle that can work without RubyGems or Bundler at run-time'
complete -f -n '__fish_bundle_using_command install' -c bundle -s P -l trust-policy -d 'Apply a RubyGems security policy: {High,Medium,Low,No}Security'
complete -f -n '__fish_bundle_using_command install' -c bundle -s j -l jobs -d 'Install gems parallely by starting size number of parallel workers'
complete -f -n '__fish_bundle_using_command install' -c bundle -s j -l jobs -d 'Install gems parallelly by starting size number of parallel workers'
complete -f -n '__fish_bundle_using_command install' -c bundle -l no-cache -d 'Do not update the cache in vendor/cache with the newly bundled gems'
complete -f -n '__fish_bundle_using_command install' -c bundle -l quiet -d 'Do not print progress information to stdout'
complete -f -n '__fish_bundle_using_command install' -c bundle -l clean -d 'Run bundle clean automatically after install'
@@ -56,7 +56,7 @@ complete -f -n '__fish_bundle_using_command install' -c bundle -l no-prune -d 'D
complete -f -n '__fish_bundle_using_command install' -c bundle -l frozen -d 'Do not allow the Gemfile.lock to be updated after this install'
# Update
complete -f -n '__fish_bundle_no_command' -c bundle -a 'update' -d 'Update dependencies to their latest versions'
complete -f -n '__fish_bundle_no_command' -c bundle -a 'update' -d 'Update dependencies to their latest versions'
complete -f -n '__fish_bundle_using_command update' -c bundle -l source -d 'The name of a :git or :path source used in the Gemfile'
complete -f -n '__fish_bundle_using_command update' -c bundle -l local -d 'Do not attempt to fetch gems remotely and use the gem cache instead'
complete -f -n '__fish_bundle_using_command update' -c bundle -l quiet -d 'Only output warnings and errors'
@@ -75,7 +75,7 @@ complete -f -n '__fish_bundle_using_command binstubs' -c bundle -l force -d 'Ove
complete -f -n '__fish_bundle_using_command binstubs' -c bundle -a '(__fish_bundled_gems)'
# Exec
complete -f -n '__fish_bundle_no_command' -c bundle -a 'exec' -d 'Execute a script in the context of the current bundle'
complete -f -n '__fish_bundle_no_command' -c bundle -a exec -d 'Execute a script in the context of the current bundle'
complete -f -n '__fish_bundle_using_command exec' -c bundle -l keep-file-descriptors -d 'Exec runs a command, providing it access to the gems in the bundle'
# Help
@@ -83,7 +83,7 @@ complete -f -n '__fish_bundle_no_command' -c bundle -a 'help' -d 'Describe avail
complete -f -n '__fish_bundle_using_command help' -c bundle -a 'install' -d 'Install the gems specified by the Gemfile or Gemfile.lock'
complete -f -n '__fish_bundle_using_command help' -c bundle -a 'update' -d 'Update dependencies to their latest versions'
complete -f -n '__fish_bundle_using_command help' -c bundle -a 'package' -d 'Package .gem files into the vendor/cache directory'
complete -f -n '__fish_bundle_using_command help' -c bundle -a 'exec' -d 'Execute a script in the context of the current bundle'
complete -f -n '__fish_bundle_using_command help' -c bundle -a exec -d 'Execute a script in the context of the current bundle'
complete -f -n '__fish_bundle_using_command help' -c bundle -a 'config' -d 'Specify and read configuration options for bundler'
complete -f -n '__fish_bundle_using_command help' -c bundle -a 'check' -d 'Check bundler requirements for your application'
complete -f -n '__fish_bundle_using_command help' -c bundle -a 'list' -d 'Show all of the gems in the current bundle'
@@ -145,7 +145,7 @@ complete -f -n '__fish_bundle_using_command init' -c bundle -l gemspec -d 'Use a
# Gem
complete -f -n '__fish_bundle_no_command' -c bundle -a 'gem' -d 'Create a simple gem, suitable for development with bundler'
complete -f -n '__fish_bundle_using_command gem' -c bundle -s b -l bin -d 'Generate a binary for your library'
complete -f -n '__fish_bundle_using_command gem' -c bundle -s b -l bin -d 'Generate a binary for your library'
complete -f -n '__fish_bundle_using_command gem' -c bundle -s t -l test -d 'Generate a test directory for your library (rspec or minitest)'
complete -f -n '__fish_bundle_using_command gem' -c bundle -s e -l edit -d 'Path to your editor'
complete -f -n '__fish_bundle_using_command gem' -c bundle -l ext -d 'Generate the boilerplate for C extension code'
@@ -155,7 +155,7 @@ complete -f -n '__fish_bundle_no_command' -c bundle -a 'platform' -d 'Displays p
complete -f -n '__fish_bundle_using_command platform' -c bundle -l ruby -d 'Only display Ruby directive information'
# Clean
complete -f -n '__fish_bundle_no_command' -c bundle -a 'clean' -d 'Cleans up unused gems in your bundler directory'
complete -f -n '__fish_bundle_no_command' -c bundle -a 'clean' -d 'Cleans up unused gems in your bundler directory'
complete -f -n '__fish_bundle_using_command clean' -c bundle -l dry-run -d 'Only print out changes, do not actually clean gems'
complete -f -n '__fish_bundle_using_command clean' -c bundle -l force -d 'Forces clean even if --path is not set'

View File

@@ -7,22 +7,22 @@
# A simple wrapper to call busctl with the correct mode and output
function __fish_busctl
# TODO: If there's a "--address" argument we need to pass that
# We also need to pass the _last_ of these (`busctl --user --system` operates on the system bus)
set -l mode
# TODO: If there's a "--address" argument we need to pass that
# We also need to pass the _last_ of these (`busctl --user --system` operates on the system bus)
set -l mode
if __fish_contains_opt user
set mode "--user"
else
set mode "--system"
end
set mode "--user"
else
set mode "--system"
end
command busctl $mode $argv --no-legend --no-pager 2>/dev/null
end
function _fish_busctl
set -l args a-address= s-show-machine u-unique A-acquired ä-activatable \
m-match= S-size= l-list q-quiet v-verbose e-expect-reply= Ä-auto-start= \
1-allow-interactive-authorization= t-timeout= 2-augment-creds= U-user 3-system \
H/host= M/machine= n-no-pager N-no-legend h/help V-version
m-match= S-size= l-list q-quiet v-verbose e-expect-reply= Ä-auto-start= \
1-allow-interactive-authorization= t-timeout= 2-augment-creds= U-user 3-system \
H/host= M/machine= n-no-pager N-no-legend h/help V-version
set -l cmdline (commandline -opc) (commandline -ct)
set -e cmdline[1]
argparse $args -- $cmdline 2>/dev/null
@@ -91,27 +91,29 @@ function _fish_busctl
end
function __fish_busctl_busnames
__fish_busctl list --acquired | string replace -r '\s+.*$' ''
# Describe unique names (":1.32") with their process (e.g. `:1.32\tsteam`)
__fish_busctl list --unique | string replace -r '\s+\S+\s+(\S+)\s+.*$' '\t$1'
__fish_busctl list --acquired | string replace -r '\s+.*$' ''
# Describe unique names (":1.32") with their process (e.g. `:1.32\tsteam`)
__fish_busctl list --unique | string replace -r '\s+\S+\s+(\S+)\s+.*$' '\t$1'
end
function __fish_busctl_objects -a busname
__fish_busctl tree --list $busname | string replace -r '\s+.*$' ''
__fish_busctl tree --list $busname | string replace -r '\s+.*$' ''
end
function __fish_busctl_interfaces -a busname -a object
__fish_busctl introspect --list $busname $object | string replace -r '\s+.*$' ''
__fish_busctl introspect --list $busname $object | string replace -r '\s+.*$' ''
end
function __fish_busctl_members -a type -a busname -a object -a interface
__fish_busctl introspect --list $busname $object $interface \
| string match -- "* $type *" | string replace -r '.(\S+) .*' '$1'
__fish_busctl introspect --list $busname $object $interface \
| string match -- "* $type *" | string replace -r '.(\S+) .*' '$1'
end
function __fish_busctl_signature -a busname -a object -a interface -a member
__fish_busctl introspect --list $busname $object $interface \
| string match ".$member *" | while read a b c d; echo $c; end
__fish_busctl introspect --list $busname $object $interface \
| string match ".$member *" | while read a b c d
echo $c
end
end
### Commands

View File

@@ -16,7 +16,7 @@ complete -c bzip2 -s t -l test -d "Check integrity"
complete -c bzip2 -s f -l force -d "Overwrite"
complete -c bzip2 -s k -l keep -d "Do not overwrite"
complete -c bzip2 -s s -l small -d "Reduce memory usage"
complete -c bzip2 -s q -l quiet -d "Supress errors"
complete -c bzip2 -s q -l quiet -d "Suppress errors"
complete -c bzip2 -s v -l verbose -d "Print compression ratios"
complete -c bzip2 -s L -l license -d "Print license"
complete -c bzip2 -s V -l version -d "Display version and exit"

View File

@@ -1,12 +1,12 @@
function __fish_complete_cabal
if type -q -f cabal
set cmd (commandline -poc)
if test (count $cmd) -gt 1
cabal $cmd[2..-1] --list-options
else
cabal --list-options
end
if type -q -f cabal
set cmd (commandline -poc)
if test (count $cmd) -gt 1
cabal $cmd[2..-1] --list-options
else
cabal --list-options
end
end
end
complete -c cabal -a '(__fish_complete_cabal)'

View File

@@ -1,27 +1,27 @@
# Caddy is a general-purpose HTTP/2 web server that serves HTTPS by default.
# https://caddyserver.com
complete -c caddy -o agree -d "Agree to the CA's Subscriber Agreement"
complete -c caddy -x -o ca -d "URL to certificate authority's ACME server directory"
complete -c caddy -x -o catimeout -d "Default ACME CA HTTP timeout"
complete -c caddy -r -o conf -a stdin -d "Caddyfile to load"
complete -c caddy -x -o cpu -d "CPU cap"
complete -c caddy -o disable-http-challenge -d "Disable the ACME HTTP challenge"
complete -c caddy -o disable-tls-sni-challenge -d "Disable the ACME TLS-SNI challenge"
complete -c caddy -x -o email -d "Default ACME CA account email address"
complete -c caddy -x -o grace -d "Maximum duration of graceful shutdown"
complete -c caddy -x -o host -d "Default host"
complete -c caddy -x -o http-port -d "Default port to use for HTTP"
complete -c caddy -o http2 -d "Use HTTP/2"
complete -c caddy -x -o https-port -d "Default port to use for HTTPS"
complete -c caddy -r -o log -d "Process log file"
complete -c caddy -r -o pidfile -d "Path to write pid file"
complete -c caddy -o plugins -d "List installed plugins"
complete -c caddy -x -o port -d "Default port"
complete -c caddy -o quic -d "Use experimental QUIC"
complete -c caddy -o quiet -d "Quiet mode (no initialization output)"
complete -c caddy -x -o revoke -d "Hostname for which to revoke the certificate"
complete -c caddy -r -o root -d "Root path of default site"
complete -c caddy -x -o type -d "Type of server to run"
complete -c caddy -o validate -d "Parse the Caddyfile but do not start the server"
complete -c caddy -o version -d "Show version"
complete -c caddy -o agree -d "Agree to the CA's Subscriber Agreement"
complete -c caddy -x -o ca -d "URL to certificate authority's ACME server directory"
complete -c caddy -x -o catimeout -d "Default ACME CA HTTP timeout"
complete -c caddy -r -o conf -a stdin -d "Caddyfile to load"
complete -c caddy -x -o cpu -d "CPU cap"
complete -c caddy -o disable-http-challenge -d "Disable the ACME HTTP challenge"
complete -c caddy -o disable-tls-sni-challenge -d "Disable the ACME TLS-SNI challenge"
complete -c caddy -x -o email -d "Default ACME CA account email address"
complete -c caddy -x -o grace -d "Maximum duration of graceful shutdown"
complete -c caddy -x -o host -d "Default host"
complete -c caddy -x -o http-port -d "Default port to use for HTTP"
complete -c caddy -o http2 -d "Use HTTP/2"
complete -c caddy -x -o https-port -d "Default port to use for HTTPS"
complete -c caddy -r -o log -d "Process log file"
complete -c caddy -r -o pidfile -d "Path to write pid file"
complete -c caddy -o plugins -d "List installed plugins"
complete -c caddy -x -o port -d "Default port"
complete -c caddy -o quic -d "Use experimental QUIC"
complete -c caddy -o quiet -d "Quiet mode (no initialization output)"
complete -c caddy -x -o revoke -d "Hostname for which to revoke the certificate"
complete -c caddy -r -o root -d "Root path of default site"
complete -c caddy -x -o type -d "Type of server to run"
complete -c caddy -o validate -d "Parse the Caddyfile but do not start the server"
complete -c caddy -o version -d "Show version"

View File

@@ -0,0 +1,5 @@
# The following lists are complete as of FreeBSD 12
set -l commands aam apm attrib cmd debug defects devlist eject epc format fwdownload help hpa identify idle inquiry load modepage negotiate opcodes periphlist persist readcap reportluns reprobe rescan reset sanitize security sleep smpcmd smpmaninfo smppc smpphylist smprg standby start stop tags timestamp tur zone
complete -c camcontrol -n '__fish_is_first_token' -xa "$commands"

View File

@@ -1,17 +1,17 @@
function __fish_canto_using_command
set cmd (commandline -opc)
if [ (count $cmd) -gt 1 ]
if [ $argv[1] = $cmd[2] ]
return 0
set cmd (commandline -opc)
if [ (count $cmd) -gt 1 ]
if [ $argv[1] = $cmd[2] ]
return 0
end
if [ count $argv -gt 2 ]
if [ $argv[2] = $cmd[2] ]
return 0
end
end
end
if [ count $argv -gt 2 ]
if [ $argv[2] = $cmd[2] ]
return 0
end
end
end
return 1
return 1
end
@@ -25,7 +25,7 @@ complete -f -c canto -s n -l checknew -d 'Show number of new items for feed'
complete -f -c canto -n '__fish_canto_using_command -l --checknew' -d 'Feed' -a '(command canto -l)'
complete -c canto -s o -l opml -d 'Print conf as OPML'
complete -c cnato -s i -l import -d 'Import from OPML'
complete -c canto -s i -l import -d 'Import from OPML'
complete -f -c canto -s r -l url -d 'Add feed'
complete -c canto -s D -l dir -d 'Set configuration directory'

View File

@@ -13,43 +13,43 @@ complete -c cargo -f -c cargo -n '__fish_use_subcommand' -a '$__fish_cargo_subco
complete -c cargo -x -c cargo -n '__fish_seen_subcommand_from help' -a '$__fish_cargo_subcommands'
for x in bench build clean doc fetch generate-lockfile \
locate-project package pkgid publish \
read-manifest run rustc test update \
verify-project;
complete -c cargo -r -n "__fish_seen_subcommand_from $x" -l manifest-path -d 'path to the manifest to compile'
locate-project package pkgid publish \
read-manifest run rustc test update \
verify-project
complete -c cargo -r -n "__fish_seen_subcommand_from $x" -l manifest-path -d 'path to the manifest to compile'
end
for x in bench build clean doc rustc test update;
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -s p -l spec -d 'Package to build'
for x in bench build clean doc rustc test update
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -s p -l spec -d 'Package to build'
end
for x in bench build clean doc run rustc test;
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l target -d 'Build for the target triple'
for x in bench build clean doc run rustc test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l target -d 'Build for the target triple'
end
for x in bench build rustc test;
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bench -d 'Only the specified benchmark'
complete -c cargo -n "__fish_seen_subcommand_from $x" -l lib -d 'Only this package\'s library'
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l test -d 'Only the specified test'
for x in bench build rustc test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bench -d 'Only the specified benchmark'
complete -c cargo -n "__fish_seen_subcommand_from $x" -l lib -d 'Only this package\'s library'
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l test -d 'Only the specified test'
end
for x in bench build run rustc test;
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bin -d 'Only the specified binary'
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l example -d 'Only the specified example'
for x in bench build run rustc test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bin -d 'Only the specified binary'
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l example -d 'Only the specified example'
end
for x in build run rustc test;
complete -c cargo -n "__fish_seen_subcommand_from $x" -l release -d 'Build artifacts in release mode, with optimizations'
for x in build run rustc test
complete -c cargo -n "__fish_seen_subcommand_from $x" -l release -d 'Build artifacts in release mode, with optimizations'
end
for x in bench test;
complete -c cargo -n "__fish_seen_subcommand_from $x" -l no-run -d 'Compile but do not run'
for x in bench test
complete -c cargo -n "__fish_seen_subcommand_from $x" -l no-run -d 'Compile but do not run'
end
for x in bench build doc run rustc test;
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -s j -l jobs -d 'Number of jobs to run in parallel'
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l features -d 'Space-separated list of features to also build'
complete -c cargo -n "__fish_seen_subcommand_from $x" -l no-default-features -d 'Do not build the `default` feature'
for x in bench build doc run rustc test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -s j -l jobs -d 'Number of jobs to run in parallel'
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l features -d 'Space-separated list of features to also build'
complete -c cargo -n "__fish_seen_subcommand_from $x" -l no-default-features -d 'Do not build the `default` feature'
end
complete -c cargo -n '__fish_seen_subcommand_from doc' -l no-deps -d 'Don\'t build documentation for dependencies'
@@ -63,21 +63,21 @@ complete -c cargo -n '__fish_seen_subcommand_from new' -l bin
complete -c cargo -x -n '__fish_seen_subcommand_from git-checkout' -l url
complete -c cargo -x -n '__fish_seen_subcommand_from git-checkout' -l reference
for x in login publish search;
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l host -d 'The host to submit the request to'
for x in login publish search
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l host -d 'The host to submit the request to'
end
complete -c cargo -n '__fish_seen_subcommand_from doc' -l open -d 'Opens the docs in a browser after the operation'
complete -c cargo -r -n '__fish_seen_subcommand_from owner' -s a -l add -d 'Login of a user to add as an owner'
complete -c cargo -r -n '__fish_seen_subcommand_from owner' -s r -l remove -d 'Login of a user to remove as an owner'
complete -c cargo -r -n '__fish_seen_subcommand_from owner' -s r -l remove -d 'Login of a user to remove as an owner'
for x in owner yank;
complete -c cargo -r -n "__fish_seen_subcommand_from $x" -l index -d 'Registry index to use'
for x in owner yank
complete -c cargo -r -n "__fish_seen_subcommand_from $x" -l index -d 'Registry index to use'
end
for x in owner publish yank;
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l token -d 'API token to use when authenticating'
for x in owner publish yank
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l token -d 'API token to use when authenticating'
end
complete -c cargo -n '__fish_seen_subcommand_from package' -l no-verify -d 'Don\'t verify the contents by building them'

Some files were not shown because too many files have changed in this diff Show More