Commit graph

8252 commits

Author SHA1 Message Date
ridiculousfish
d17b298a48 Factor out the code that executes a builtin from exec_job()
Very early work on untangling the exec_job spaghetti.
2017-12-22 13:41:29 -08:00
ridiculousfish
7db5d573c2 Document fish_color_selection
Fixes #4544
2017-12-22 12:41:35 -08:00
David Adam
b680db8ce6 Bump version for 2.7.1 2017-12-23 00:16:29 +08:00
David Adam
cd5c40ed9c CHANGELOG: update for 2.7.1 2017-12-23 00:16:24 +08:00
David Adam
fd10c29211 Disable __update_cwd_osx for iTerm.app
Fixes #4521.

(cherry picked from commit 5faa425df1)
2017-12-22 22:10:36 +08:00
ridiculousfish
9907a8df4d Fix test hang when running under ninja
The psub tests create a fifo and launch a background job to write to it.
However fifos have this obnoxious behavior where opening the file blocks
until both sides are ready. In one of the tests we don't actually read
from the fifo we create, so the background job hangs, and the tests
never complete. Fix this by just reading from the fifo.
2017-12-21 15:48:48 -08:00
ridiculousfish
a2114233ac Fix some warnings 2017-12-21 15:48:48 -08:00
Fabian Homborg
4096a7fda9 Revert "Fix "Unknown argument -s" error in fish_vi_key_bindings"
Unfortunately this made tests on travis fail - for some reason I still need to figure out.

This reverts commit 5acbd32c2e.
2017-12-22 00:44:18 +01:00
ridiculousfish
f563262cfd Mark tests as USES_TERMINAL
This allows the Ninja build to show the test output live.
This requires bumping the min required CMake version to 3.2 (from 3.1)
2017-12-21 12:48:17 -08:00
ridiculousfish
0c55b79cfc [string] Instance the argument parsing
This adds a new class arg_iterator_t which encapsulates decisions about
whether to read arguments from stdin or argv. It also migrates the
unread bytes buffer from a static variable to an instance variable.
2017-12-21 12:42:57 -08:00
Yurizal Susanto
94ff789c4b Add eopkg completion support (#4600)
* Add eopkg support

Add support for eopkg in __fish_print_packages function, and
add new completion eopkg.fish in share/completions

* Sorry for the empty file

* Sorry for the empty file again

* Use builtin function for checking subcommand and options

* Fix description

* Use string function to replace grep and cut

* Add completion for search command
2017-12-21 16:43:21 +01:00
David Guyot
dcf9ce6fc5 Added completions/translations for zfs and zpool 2017-12-21 16:39:06 +01:00
Fabian Homborg
5acbd32c2e Fix "Unknown argument -s" error in fish_vi_key_bindings
This was caused by it prepending "-s" to argv always,
and later checking $argv[1].

As it turns out, that is kinda superfluous, so we can just add "-s" to
the `bind` calls.

Also adjust the tests so the vi-bindings are enabled via the function,
which would have caught this.

Fixes #4494.
2017-12-21 16:17:21 +01:00
Fabian Homborg
884092d13b CHANGELOG 4610 2017-12-20 14:36:13 +01:00
Fabian Homborg
f9d883dd74 Add and use str2wcstring(string, size_t)
This is just for convenience.
2017-12-20 14:31:29 +01:00
Fabian Homborg
2de38ef7bf [string] Chunk reads
Profiling with callgrind revealed that about 60% of the time in a `something | string match` call
was actually spent in `string_get_arg_stdin()`,
because it was calling `read` one byte at a time.

This makes it read in chunks similar to builtin read.

This increases performance for `getent hosts | string match -v '0.0.0.0*'` from about 300ms to about 30ms (i.e. 90%).
At that point it's _actually_ quicker than `grep`.

To improve performance even more, we'd have to cut down on str2wcstring.

Fixes #4604.
2017-12-20 14:30:41 +01:00
ridiculousfish
ec2b38053e
Merge pull request #4612 from ridiculousfish/muparser-no-except
Muparser Exceptectomy

This removes large pieces of muParser that fish does not use, such as its optimizer. It also switches muParser from throwing exceptions to propagating errors explicitly.
2017-12-19 09:34:32 -08:00
ridiculousfish
873ea0f0df [muparser] Remove OnDetectVar and Diff
These are unused and useless.
2017-12-18 23:01:18 -08:00
ridiculousfish
2c317a2585 [muparser] Remove muParserFixes.h
This appears to be random pragmas for ICC only.
2017-12-18 23:01:18 -08:00
ridiculousfish
886341fdea [muparser] Remove ParserCallback m_bAllowOpti flag
muParser can no longer optimize, so this is unused.
2017-12-18 23:01:18 -08:00
ridiculousfish
e728bf45de [muparser] Remove m_strFormula from the ParserError 2017-12-18 23:01:18 -08:00
ridiculousfish
409173e0f0 [muparser] Default ParserError's constructors
No need to define these explicitly when the defaults will do.
2017-12-18 23:01:18 -08:00
ridiculousfish
e9c106b881 [muparser] Delete ParserByteCode copy and assignment ctors
These are not used.
2017-12-18 23:01:18 -08:00
ridiculousfish
8b0d2ff641 [muparser] Remove muParserTemplateMagic.h
This header is now empty
2017-12-18 23:01:18 -08:00
ridiculousfish
1f456c71f7 [muparser] Remove MathImpl
This layer of indirection is silly.
2017-12-18 23:01:18 -08:00
ridiculousfish
f0de6e0852 [muparser] Remove struct TypeInfo
The STL's facilities are totally sufficient here.
2017-12-18 23:01:18 -08:00
ridiculousfish
364f58fcfa Remove some deleted muparser headers from Xcode build 2017-12-18 23:01:18 -08:00
ridiculousfish
fd60a7cff7 [muparser] Remove unused fields from SToken 2017-12-18 23:01:17 -08:00
ridiculousfish
732b32c8b4 [muparser] Clean up constructors and other miscellaneous 2017-12-18 23:01:17 -08:00
ridiculousfish
e675a66504 [muparser] Remove some unused "optimized" opcodes 2017-12-18 23:01:17 -08:00
ridiculousfish
3f21fb64de [muparser] Remove additional unused functions 2017-12-18 23:01:17 -08:00
ridiculousfish
ab95f94048 [muparser] Remove m_nIfElseCounter instance variable
No idea why this isn't just a local.
2017-12-18 23:01:17 -08:00
ridiculousfish
4452d9ce18 [muparser] Remove m_pParseFormula function pointer
This is a very strange design that determines whether initialization
needs to be performed by reassigning a function pointer. A misguided
optimization? Just check explicitly.
2017-12-18 23:01:17 -08:00
ridiculousfish
3ed9c851a3 [muparser] Remove some OpenMP / "bulk mode" detritus 2017-12-18 23:01:17 -08:00
ridiculousfish
fdefabdb1d [muparser] Remove fun_type overloads that have four or more parameters
Supporting these is rather excessive.
2017-12-18 23:01:17 -08:00
ridiculousfish
bb9e15675e [muparser] Remove muParserDLL.h and muParserDLL.cpp
This is a C interface (?) which fish does not use and is not needed.
2017-12-18 23:01:17 -08:00
ridiculousfish
128aacaf87 [muparser] Disable muparser shared lib build
fish does not use its shared library, only the static one
2017-12-18 23:01:17 -08:00
ridiculousfish
554382a286 [muparser] Remove 'AllowOpt' parameters
This parameter was used as a hint to optimize functions invoked
with constants, but is no longer used.
2017-12-18 23:01:17 -08:00
ridiculousfish
452211ebf5 Disable exception handling in autotools build
Now that muparser no longer relies on exceptions, we can disable them
again.
2017-12-18 23:01:17 -08:00
ridiculousfish
3099d46736 Disable exception handling in CMake build
Now that muparser no longer relies on exceptions, we can disable them
again.
2017-12-18 23:01:17 -08:00
ridiculousfish
8b16fccebf Disable exception handling in Xcode build
Now that muparser no longer relies on exceptions, we can disable them
again.
2017-12-18 23:01:17 -08:00
ridiculousfish
11e6cfeb82 [math] Remove exception handling in builtin_math
This handles errors explicitly instead of catching them.
2017-12-18 23:01:16 -08:00
ridiculousfish
5d2cf3f666 [muparser] Remove getOrThrow()
This is no longer used or needed
2017-12-18 23:01:16 -08:00
ridiculousfish
2f2f4b4287 [muparser] ParserBase::Eval to return an error instead of throwing 2017-12-18 23:01:16 -08:00
ridiculousfish
11d729d09c [muparser] DefineFun() to return an error instead of throwing 2017-12-18 23:01:16 -08:00
ridiculousfish
6f14d55612 [muparser] Convert more exception handling into explicit errors 2017-12-18 23:01:16 -08:00
ridiculousfish
d3822e4cb3 [muparser] Propogate and check for lots more errors 2017-12-18 23:01:16 -08:00
ridiculousfish
0be08e4683 [muparser] DefinePostfixOprt and DefineInfixOprt to return errors
Return errors explicitly instead of throwing.
2017-12-18 23:01:16 -08:00
ridiculousfish
f3a9773849 [muparser] Make some error handling in ParserBase explicit
Return ParserError instead of throwing exceptions
2017-12-18 23:01:16 -08:00
ridiculousfish
62bedde23d [muparser] Clean up error handling in ParserTokenReader 2017-12-18 23:01:16 -08:00