App-Raps2

 view release on metacpan or  search on metacpan

bin/raps2  view on Meta::CPAN

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
        my ( $file, $name ) = @_;
 
        if ( not defined $file ) {
                say STDERR "No such account: ${name}";
                exit 2;
        }
 
        return;
}
 
sub file_must_not_exist {
        my ( $file, $name ) = @_;
 
        if ( -e $file ) {
                say STDERR "Account already exists: ${name}";
                exit 2;
        }
 
        return;
}
 
sub cmd_add {
        my ($name) = @_;
 
        if ( not $name ) {
                cmd_help( 1, 'add <account>' );
        }
 
        my $pwfile = data_home('raps2') . "/${name}";
 
        file_must_not_exist( $pwfile, $name );
 
        $raps2->get_master_password();
 
        my $url   = $raps2->ui->read_line('URL');
        my $login = $raps2->ui->read_line('Login');
        my $pass  = $raps2->ui->read_pw( 'Password', 1 );
        my $extra = $raps2->ui->read_multiline('Additional content');
 
        if ( length($pass) == 0 ) {
                $pass = $raps2->generate_password();



( run in 1.199 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )