diff options
author | Fabian Homborg <FHomborg@gmail.com> | 2016-02-10 20:33:43 +0100 |
---|---|---|
committer | Fabian Homborg <FHomborg@gmail.com> | 2016-02-10 20:33:43 +0100 |
commit | 52f8707c3e3f97a6a257a4fe7349aee45e9a5782 (patch) | |
tree | 4ae146c42d27f2d87c54f6f3b64a4c7783b4e4b6 /share/functions | |
parent | b6e058985be524ba94544d541abc1ca9c4817133 (diff) |
Use string split in export.fish
It's a bit more explicit than replace.
Diffstat (limited to 'share/functions')
-rw-r--r-- | share/functions/export.fish | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/share/functions/export.fish b/share/functions/export.fish index 3f83cf4e..ae4a4a1b 100644 --- a/share/functions/export.fish +++ b/share/functions/export.fish @@ -4,11 +4,8 @@ function export --description 'Set global variable. Alias for set -gx, made for return 0 end for arg in $argv - # Only split on the first = - # The literal "\n" is necessary because string doesn't interpret it without -r - set -l v (echo $arg | string replace "=" \n) - set -l c (count $v) - switch $c + set -l v (string split -m 1 "=" -- $arg) + switch (count $v) case 1 set -gx $v $$v case 2 |