Commit graph

8 commits

Author SHA1 Message Date
ridiculousfish
4b079e16e5 Execute the conditions of if and while statements outside of their block
Variables set in if and while conditions are in the enclosing block, not
the if/while statement block. For example:

    if set -l var (somecommand) ; end
    echo $var

will now work as expected.

Fixes #4820. Fixes #1212.
2018-03-31 14:57:24 -07:00
Kurtis Rader
67de733b9b implement set --append and set --prepend
Fixes #1326
2017-08-04 17:23:24 -07:00
Kurtis Rader
4197420f39 implement limits on command substitution output
This makes command substitutions impose the same limit on the amount
of data they accept as the `read` builtin. It does not limit output of
external commands or builtins in other contexts.

Fixes #3822
2017-08-03 17:40:25 -07:00
ridiculousfish
0a6f62358b Write tests for new if/and/or behavior (#1428)
They fail for now.
2015-12-19 11:32:57 -08:00
ridiculousfish
e632d39b1f Make if statements always return success at the end, matching other
shells. Fixes #1061.
2014-02-07 17:57:53 -08:00
maxfl
079f17761c Fix case when first index is command substitution 2012-07-08 09:45:34 +08:00
maxfl
e1b8c425da Fix case when second limit is a variable:
echo $PATH[1..$n]
2012-07-08 09:39:39 +08:00
maxfl
5f05756e65 Add variable expand ranges
echo $PATH[-1..1] #now works

Add tests for ranges
2012-07-08 09:19:11 +08:00