aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/export.fish
blob: ae4a4a1bbfb0d71177b0bdc01c64d03a2ea78fd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 (string split -m 1 "=" -- $arg)
        switch (count $v)
            case 1
                set -gx $v $$v
            case 2
                set -gx $v[1] $v[2]
        end
    end
end