From: Graham Knop Date: Wed, 20 Nov 2013 09:32:21 +0000 (-0500) Subject: fish shell support X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ea713040a15ab3150bb8f4a4f1239dd85132fde9;p=p5sagit%2Flocal-lib.git fish shell support --- diff --git a/lib/local/lib.pm b/lib/local/lib.pm index a8fc12f..9fd7017 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -442,6 +442,16 @@ sub wrap_powershell_output { return $out || " \n"; } +sub build_fish_env_declaration { + my ($class, $name, $args) = @_; + my $value = $class->_interpolate($args, '"%s"', '"', '\\%s'); + if (!defined $value) { + return qq{set -e $name;\n}; + } + $value =~ s/$_path_sep/ /; + qq{set -x $name $value;\n}; +} + sub _interpolate { my ($class, $args, $var_pat, $escape, $escape_pat) = @_; return