Commit Graph

7631 Commits

Author SHA1 Message Date
Aaron Gyes
7be8a1707c Rename FISH_READ_BYTE_LIMIT to fish_read_limit
Fixes #4414
2017-10-14 08:33:02 -07:00
Aaron Gyes
18b06f3768 Rename CMD_DURATION to cmd_duration
Fixes #4414
2017-10-14 08:33:02 -07:00
Fabian Homborg
1af38d69a8 Fix cd completions if a directory exists in $CDPATH and $PWD
E.g. if "foo" is in CDPATH, and both "foo/bar" and "./bar" exist, `cd
bar` will go to ./bar.

The completions described "bar" as going to "foo/bar" ("CDPATH foo").

This fixes it by checking for ./bar's existence.

See #4475.
2017-10-13 18:32:36 +02:00
Mahmoud Al-Qudsi
0a1294758d Replace opts.stdout with opts.to_stdout
For some reason on Solaris the previous code was refusing to compile
with an error (regarding the declaration of stdout in the opts struct)

    error: declaration of ‘__iob’ as array of references

The obvious guess that it had something to do with the name of the
variable in question proved true; renaming it from `stdout` to
`opts.stdout` allows the build to go through.
2017-10-12 11:44:14 -05:00
Mahmoud Al-Qudsi
b7f1103088 Silence directory change messages when calling gmake from BSD make
These messages are automatically generated as if `-w` were specified
at the gmake command line. The `--no-print-directory` option supresses
these messages.
2017-10-12 12:50:21 -05:00
Mahmoud Al-Qudsi
40a90f1b2f Update BSDMakefile to force build of targets
.DEFAULT or .DONE cannot be set as .PHONY so this hack was required.
2017-10-12 12:45:10 -05:00
madblobfish
649e244092 fish_update_completions: error when python not found (#4454) 2017-10-12 06:00:50 -07:00
evuez
6d350409b3 Add --follow-tags completion for git push (#4462) 2017-10-12 05:59:52 -07:00
Aaron Gyes
68527ff20c completions: --description -> -d
This ends up saving a surprising number of bytes.
2017-10-11 10:17:35 -07:00
Aaron Gyes
020f8097f0 uniq completions: fix spelling
it's -> its
2017-10-11 10:08:05 -07:00
ridiculousfish
1f130bcc9c Change wrealpath to return a maybe_t
Simplify the wrealpath interface and avoid manual invocations of free() by
changing wrealpath to return a maybe_t<wcstring>.
2017-10-11 00:08:26 -07:00
ridiculousfish
05c0cb713d Stop passing NULL for realpath()'s second param
macOS 10.5 and earlier do not support the convention of returning
a dynamically allocated string, plus this seems like an unnecessary
malloc. Always allocate a buffer for realpath() to write into.
2017-10-10 23:31:27 -07:00
Mahmoud Al-Qudsi
639faf1c7f Fix uninitialized memory access dependent on argc
It seems that `parse_cmd_opts` does not correctly handle no arguments,
and so argc was being decremented to -1 causing uninitialized memory
access when argv[0] was dereferenced at a later point.
2017-10-11 07:22:42 +02:00
Mahmoud Al-Qudsi
98eceba124 Include flatpak improvements in Changelog for 2.7.0b1
(cherry picked from commit 03366333b2)
2017-10-11 06:27:53 +02:00
Mahmoud Al-Qudsi
1a3adf086d Coalesce string trim and string match in flatpak completions 2017-10-11 06:23:02 +02:00
David Adam
a136bbdad9 travis: run autoreconf with --no-recursive 2017-10-10 15:14:44 +08:00
Mahmoud Al-Qudsi
2d99623b17 Merge pull request #4407 from mqudsi/read_stdout
Support reading to stdout via builtin `read` invoked without parameters.
2017-10-10 08:37:41 +02:00
Mahmoud Al-Qudsi
101ada83cb Fix unit tests for read to stdout behavior 2017-10-10 08:34:50 +02:00
Mahmoud Al-Qudsi
8ffc3ab242 Drop no-longer-needed iostream header from src/builtin_read.cpp 2017-10-10 08:23:24 +02:00
Mahmoud Al-Qudsi
4780b28a93 Updated read docs to include new stdout behavior 2017-10-10 08:23:24 +02:00
Mahmoud Al-Qudsi
109769a147 Update Changelog.md to reflect new read builtin behavior 2017-10-10 08:23:23 +02:00
Mahmoud Al-Qudsi
d0bc04cb40 Change read to stdout behavior to kick in on no arguments only
No longer using `-` to indicate reading to stdout. Use lack of arguments
as stdout indicator. This prevents mixing of variables with stdout
reading and makes it clear that stdout may not be mixed with delimiters
or array mode.
2017-10-10 08:23:23 +02:00
Mahmoud Al-Qudsi
ec56b632f5 Add read to stdout improvement to README.md 2017-10-10 08:23:23 +02:00
Mahmoud Al-Qudsi
06afcb43b4 Support reading to stdout via builtin read -
Added an option to read to stdout via `read -`. While it may seem
useless at first blush, it lets you do things like include

    mysql -p(read --silent) ...

Without needing to save to a local variable and then echo it back.
Kicks in when `-` is provided as the variable name to read to. This is
in keeping with the de facto syntax for reading/writing from/to
stdin/stdout instead of a file in, e.g., tar, cat, and other standard
unix utilities.
2017-10-10 08:23:23 +02:00
Mahmoud Al-Qudsi
15bdf6fa00 Merge pull request #4404 from krader1961/history-glob-search
Implement `history search` glob searches
2017-10-10 08:17:16 +02:00
Mahmoud Al-Qudsi
7334d801cf Merge branch 'master' into history-glob-search 2017-10-10 08:17:02 +02:00
Mahmoud Al-Qudsi
e99f137356 Merge branch 'master' into history-glob-search 2017-10-10 08:16:21 +02:00
Aaron Gyes
8b9e5c9301 Remove iwyu.sh
One should use lint.fish.
2017-10-09 22:33:28 -07:00
Amitava Bhattacharyya
48797974d3 Remove extraneous reference in FAQ (#4459)
"Use the fish_update_completions command.", the answer to "How do I update man page completions?", was also found at the end of the answer to "How do I get the exit status of a command?"
2017-10-09 22:06:56 -07:00
Aaron Gyes
59dbc7ca6a Tweak ninja completions 2017-10-09 01:22:20 -07:00
Mahmoud Al-Qudsi
21473b20ec Update flatpak completions to work with latest flatpak
Closes #4456
2017-10-09 07:30:19 +02:00
Aaron Gyes
171dea73d7 Update .gitattributes for muparser 2017-10-08 06:49:49 -07:00
Mahmoud Al-Qudsi
ff66d2f3c1 Add more test examples, including expression negation
Closes #4383
2017-10-08 02:06:48 +02:00
Mahmoud Al-Qudsi
b61c4f1cbc Correct string replace usage in pip2/3 completions
\b does not match "end of spaces" but rather "start of a-z/0-9" and so
does not match the start of string '-c'. Match (and then re-insert) a
literal ' ' as part of the pattern instead.
2017-10-05 13:54:47 +02:00
Mahmoud Al-Qudsi
04bde6cf5b Document reasons for commmand name replacement in pip2/3 completions
(cherry picked from commit 429bdce4f1)
2017-10-05 13:33:45 +02:00
Mahmoud Al-Qudsi
78fe53406e Fix copy-and-paste pip3 -> pip2 typo
Thanks @floam. See #4448
2017-10-05 13:26:56 +02:00
Mahmoud Al-Qudsi
7e48f5cc4f Use string replace instead of sed with better regex for pip completions
(cherry picked from commit d74d3f2ca4)
2017-10-05 13:25:14 +02:00
Mahmoud Al-Qudsi
af12bcb117 fixup! Force correct names for pip2/pip3 command in completions 2017-10-05 13:11:14 +02:00
Mahmoud Al-Qudsi
b11ca2c01c Force correct names for pip2/pip3 command in completions
Work around bug pypa/pip#4755
Don't expect all users to be running a version of pip2/3 that includes
the fix (once it's upstreamed). Will continue to work if/when pip2/3
emit the correct output. pip is already very slow at printing the
completions (see #4448) so the `sed` call overhead is neglible.
2017-10-05 13:03:24 +02:00
Gabriel Birke
6ce03a4a36 Add script completion for composer
When no command is given or when using "run-script" parse composer.json
and look for the "scripts" section. Complete script names.
2017-10-05 10:47:34 +02:00
Aaron Gyes
d740b2a473 pip completions: use builtin source rather than eval function. 2017-10-04 21:50:09 -07:00
Cristian Prieto
1770e47eb0 Python's pip and pipenv completions (#4448)
* Add pip completion

 * We call native pip completion for fish if pip is installed

* Add pipenv completion

 * We call pipenv native completion if pipenv is installed

* Applied changes as requested by @floam

 * Changed usage of `test (command -v)` for just `command -sq`

* Add completions for pip2/3

 * In some systems pip is not aliased and we have pip2 and pip3
 * In those cases, we just load the completions for those commands

* Separate pip2/3 completions in their own file as requested by @floam
2017-10-04 21:15:41 -07:00
Mahmoud Al-Qudsi
2dd2867a61 Implement limits for __history_completions in j completions 2017-10-04 17:52:58 +02:00
Mahmoud Al-Qudsi
f18b6868b7 Include --quiet in command builtin summary 2017-10-04 12:02:52 +02:00
Mahmoud Al-Qudsi
11ede92d3f Include bind changes in Changelog for 3.0b1 2017-10-03 11:20:17 +02:00
Mahmoud Al-Qudsi
811beb9dcc Document new -s/--silent bind switch 2017-10-03 11:20:17 +02:00
Mahmoud Al-Qudsi
6e933f1c8f Add -s to builtin_bind's allowed parameter list 2017-10-03 11:20:17 +02:00
Mahmoud Al-Qudsi
46d1334f95 Silence bind errors in default key bindings
This silences binding errors due to keys not found in the current
termcap config in the default fish bindings.

Closes #4188, #4431, and obviates the original fix for #1155

It was necessary to re-implement builtin_bind as a class in order to
avoid passing around the options array from function to function and
as adding an opts parameter to `get_terminfo_sequence` would require
otps to be passed to all other builtin_bind_ functions so they could, in
turn, pass it to `get_terminfo_sequence`.
2017-10-03 11:20:17 +02:00
Mahmoud Al-Qudsi
cebb63c1b5 Merge pull request #4444 from trofi/master
Fix 'printf "%o"' handling on powerpc64
2017-10-03 09:58:23 +02:00
Sergei Trofimovich
53fd356850 fix 'printf "%o"' handling on powerpc64
On powerpc64 (big-endian platform) one test failed as:

  Testing file printf.in ... fail
  Output differs for file printf.in. Diff follows:
  --- printf.tmp.out      2017-10-02 18:14:17.740000000 -0700
  +++ printf.out  2017-10-02 18:11:59.370000000 -0700
  @@ -1,5 +1,5 @@
   Hello 1 2 3.000000 4.000000 5 6
  -a B 0 18446744073709551615
  +a B 10 18446744073709551615

It happens due to roughly the following code:
    swprintf(..., L"%o", (long long)8);
Here mismatch happens between "%o" (requires 32-bit value)
and 'long long' (requires 64-bit value).

The fix turns it effectively to:
    swprintf(..., L"%llo", (long long)8);
as it was previously done for 'x', 'd' and other int-like types.

Makes tests pass on powerpc64.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2017-10-03 04:17:56 +03:00