summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/envstore10
1 files changed, 4 insertions, 6 deletions
diff --git a/bin/envstore b/bin/envstore
index 5c27b22..5dad484 100755
--- a/bin/envstore
+++ b/bin/envstore
@@ -9,6 +9,7 @@ my $store_file = "/tmp/.envstore-$>";
my %store;
my $action = shift;
my $arg = shift;
+my $arg2 = shift;
my ($key, $value);
sub check_store {
@@ -54,11 +55,8 @@ sub save_store {
}
sub get_keyvalue {
- my $arg = shift;
- my ($key, $value);
- $arg =~ /^(\w+)(?:=(.*))?$/;
- ($key, $value) = ($1, $2);
- unless (defined($2)) {
+ my ($key, $value) = @_;
+ unless (defined($value)) {
if (exists($ENV{$key})) {
$value = $ENV{$key};
} else {
@@ -71,7 +69,7 @@ sub get_keyvalue {
load_store;
if ($action eq 'save') {
- ($key, $value) = get_keyvalue($arg);
+ ($key, $value) = get_keyvalue($arg, $arg2);
$store{$key} = $value;
save_store;
} elsif ($action eq 'eval') {