colors
This commit is contained in:
parent
5892f440e8
commit
10026e374d
28
pm.pl
28
pm.pl
@ -48,13 +48,9 @@ if ( defined($opt_s) and defined($opt_n) and !defined($opt_o) ) {
|
|||||||
|
|
||||||
$copy->copy($get_pass);
|
$copy->copy($get_pass);
|
||||||
|
|
||||||
print color 'green';
|
print colored("Password copied to xclipboard.", 'green');
|
||||||
print "Password copied to xclipboard.";
|
|
||||||
print color 'reset';
|
|
||||||
print "\nURI is ";
|
print "\nURI is ";
|
||||||
print color 'bold blue';
|
print colored($get_h->{resource} . "\n", 'bold blue');
|
||||||
print $get_h->{resource} . "\n";
|
|
||||||
print color 'reset';
|
|
||||||
}
|
}
|
||||||
elsif ( defined($opt_s) and defined($opt_n) and defined($opt_o) ) {
|
elsif ( defined($opt_s) and defined($opt_n) and defined($opt_o) ) {
|
||||||
|
|
||||||
@ -65,13 +61,9 @@ elsif ( defined($opt_s) and defined($opt_n) and defined($opt_o) ) {
|
|||||||
my @open_cmd = ( 'xdg-open', $get_h->{resource} );
|
my @open_cmd = ( 'xdg-open', $get_h->{resource} );
|
||||||
system(@open_cmd) == 0 or die "Cannot open URI: $!\n";
|
system(@open_cmd) == 0 or die "Cannot open URI: $!\n";
|
||||||
|
|
||||||
print color 'bold green';
|
print colored("Password copied to clipboard.\n", 'bold green');
|
||||||
print "Password copied to clipboard.\n";
|
|
||||||
print color 'reset';
|
|
||||||
print "Trying to open ";
|
print "Trying to open ";
|
||||||
print color 'bold blue';
|
print colored($get_h->{resource} . "\n", 'bold blue');
|
||||||
print $get_h->{resource} . "\n";
|
|
||||||
print color 'reset';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove string from db
|
# Remove string from db
|
||||||
@ -80,9 +72,7 @@ elsif ( defined($opt_r) and defined($opt_i) ) {
|
|||||||
my $store_h = { id => $opt_i, };
|
my $store_h = { id => $opt_i, };
|
||||||
|
|
||||||
$pass->remove($store_h) == 0 or die "Oops! 111: pm.pl. $!\n";
|
$pass->remove($store_h) == 0 or die "Oops! 111: pm.pl. $!\n";
|
||||||
print color 'bold red';
|
print colored("Password was removed!\n", 'bold red');
|
||||||
print "Password was removed!\n";
|
|
||||||
print color 'reset';
|
|
||||||
}
|
}
|
||||||
elsif ( defined($opt_w)
|
elsif ( defined($opt_w)
|
||||||
and defined($opt_n)
|
and defined($opt_n)
|
||||||
@ -104,9 +94,7 @@ elsif ( defined($opt_w)
|
|||||||
|
|
||||||
$pass->save($store_h) == 0 or die "Oops! 105: pm.pl. $!\n";
|
$pass->save($store_h) == 0 or die "Oops! 105: pm.pl. $!\n";
|
||||||
$copy->copy($opt_p);
|
$copy->copy($opt_p);
|
||||||
print color 'green';
|
print colored("Password was stored into DB!\n", 'green');
|
||||||
print "Password was stored into DB!\n";
|
|
||||||
print color 'reset';
|
|
||||||
}
|
}
|
||||||
elsif ( defined($opt_w)
|
elsif ( defined($opt_w)
|
||||||
and defined($opt_n)
|
and defined($opt_n)
|
||||||
@ -126,9 +114,7 @@ elsif ( defined($opt_w)
|
|||||||
};
|
};
|
||||||
|
|
||||||
$pass->save($store_h) == 0 or die "Oops! 122: pm.pl. $!\n";
|
$pass->save($store_h) == 0 or die "Oops! 122: pm.pl. $!\n";
|
||||||
print color 'green';
|
print colored("Password was stored into DB!\n", 'green');
|
||||||
print "Password was stored into DB!\n";
|
|
||||||
print color 'reset';
|
|
||||||
}
|
}
|
||||||
# Export
|
# Export
|
||||||
elsif ( defined($opt_x) ) {
|
elsif ( defined($opt_x) ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user