export: Enable values with "=" in them

Only split on the first "=" to achieve this.

Closes #2403
This commit is contained in:
Fabian Homborg 2015-09-24 15:28:58 +02:00
parent be51fe944d
commit 20e96df85d

View file

@ -1,10 +1,11 @@
function export --description 'Set global variable. Alias for set -g, made for bash compatibility'
function export --description 'Set global variable. Alias for set -gx, made for bash compatibility'
if test -z "$argv"
set
return 0
end
for arg in $argv
set -l v (echo $arg|tr '=' \n)
# Only split on the first =
set -l v (echo $arg | string replace "=" "\n")
set -l c (count $v)
switch $c
case 1