2014-05-12 15:41:05 +04:00
|
|
|
package Usage;
|
|
|
|
|
|
|
|
sub new {
|
|
|
|
my $class = shift;
|
|
|
|
my $self = {};
|
|
|
|
|
|
|
|
bless $self, $class;
|
|
|
|
return $self;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub show() {
|
|
|
|
print STDERR << "EOF";
|
|
|
|
Simple password manager writed in Perl.
|
|
|
|
|
|
|
|
-s show password
|
|
|
|
-n [Name of resource] name of resource
|
|
|
|
-w store new password
|
|
|
|
-l [Link] link to resource
|
|
|
|
-u username
|
2014-05-12 17:16:10 +04:00
|
|
|
-c comment
|
2014-05-12 15:41:05 +04:00
|
|
|
-p [Password] password
|
|
|
|
if key not selected PM generate secure password
|
|
|
|
and copy it to xclipboard
|
|
|
|
-r remove password
|
|
|
|
-i password ID
|
|
|
|
-o open link
|
2014-05-13 17:57:14 +04:00
|
|
|
-x [filename] export
|
2014-05-16 18:47:38 +04:00
|
|
|
-I [filename] import
|
2014-05-12 15:41:05 +04:00
|
|
|
-h show this help screen and exit
|
|
|
|
-v show version info and exit
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
Show all names and resources:
|
|
|
|
\tpm.pl -s -n all
|
|
|
|
|
|
|
|
Copy password for resource:
|
|
|
|
\tpm.pl -s -n LOR
|
|
|
|
\tPassword copied to xclipboard.\n\t\tURI is http://linux.org.ru/
|
|
|
|
|
|
|
|
Copy password and open link:
|
|
|
|
\tpm.pl -s -n LOR -o
|
|
|
|
\tPassword copied to clipboard. Trying to open uri.
|
|
|
|
|
|
|
|
Store new password:
|
2014-05-12 17:16:10 +04:00
|
|
|
\tpm.pl -w -n PRON -l http://superpronsite.com/ -p my_secret_password -c 'Most viewed site'
|
2014-05-12 15:41:05 +04:00
|
|
|
\tPassword for resource PRON is stored into DB!
|
|
|
|
|
|
|
|
Remove password:
|
|
|
|
\tpm.pl -r -i 13
|
|
|
|
\tPassword was removed!
|
|
|
|
|
|
|
|
EOF
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|