mpw 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/ruby
2
2
  # MPW is a software to crypt and manage your passwords
3
- # Copyright (C) 2016 Adrien Waksberg <mpw@yae.im>
4
- #
3
+ # Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
4
+ #
5
5
  # This program is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU General Public License
7
7
  # as published by the Free Software Foundation; either version 2
8
8
  # of the License, or (at your option) any later version.
9
- #
9
+ #
10
10
  # This program is distributed in the hope that it will be useful,
11
11
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
  # GNU General Public License for more details.
14
- #
14
+ #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -25,45 +25,40 @@ require 'mpw/cli'
25
25
  # --------------------------------------------------------- #
26
26
 
27
27
  options = {}
28
- options[:sync] = true
29
28
  options[:clipboard] = true
30
29
  values = {}
31
30
 
32
31
  OptionParser.new do |opts|
33
- opts.banner = "#{I18n.t('option.usage')}: mpw copy [options]"
32
+ opts.banner = "#{I18n.t('option.usage')}: mpw copy [options]"
34
33
 
35
- opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
36
- options[:config] = config
37
- end
34
+ opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
35
+ options[:config] = config
36
+ end
38
37
 
39
- opts.on('-d', '--disable-clipboard', I18n.t('option.clipboard')) do
40
- options[:clipboard] = false
41
- end
38
+ opts.on('-d', '--disable-clipboard', I18n.t('option.clipboard')) do
39
+ options[:clipboard] = false
40
+ end
42
41
 
43
- opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
44
- values[:group] = group
45
- end
42
+ opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
43
+ values[:group] = group
44
+ end
46
45
 
47
- opts.on('-h', '--help', I18n.t('option.help')) do
48
- puts opts
49
- exit 0
50
- end
46
+ opts.on('-h', '--help', I18n.t('option.help')) do
47
+ puts opts
48
+ exit 0
49
+ end
51
50
 
52
- opts.on('-n', '--no-sync', I18n.t('option.no_sync')) do
53
- options[:sync] = false
54
- end
51
+ opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
52
+ values[:pattern] = pattern
53
+ end
55
54
 
56
- opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
57
- values[:pattern] = pattern
58
- end
59
-
60
- opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
61
- options[:wallet] = wallet
62
- end
55
+ opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
56
+ options[:wallet] = wallet
57
+ end
63
58
  end.parse!
64
59
 
65
60
  config = MPW::Config.new(options[:config])
66
- cli = MPW::Cli.new(config, options[:sync])
61
+ cli = MPW::Cli.new(config)
67
62
 
68
63
  cli.load_config
69
64
  cli.get_wallet(options[:wallet])
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/ruby
2
2
  # MPW is a software to crypt and manage your passwords
3
- # Copyright (C) 2016 Adrien Waksberg <mpw@yae.im>
4
- #
3
+ # Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
4
+ #
5
5
  # This program is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU General Public License
7
7
  # as published by the Free Software Foundation; either version 2
8
8
  # of the License, or (at your option) any later version.
9
- #
9
+ #
10
10
  # This program is distributed in the hope that it will be useful,
11
11
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
  # GNU General Public License for more details.
14
- #
14
+ #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -24,41 +24,36 @@ require 'mpw/cli'
24
24
  # Options
25
25
  # --------------------------------------------------------- #
26
26
 
27
- options = {}
28
- options[:sync] = true
29
- values = {}
27
+ options = {}
28
+ values = {}
30
29
 
31
30
  OptionParser.new do |opts|
32
- opts.banner = "#{I18n.t('option.usage')}: mpw delete [options]"
31
+ opts.banner = "#{I18n.t('option.usage')}: mpw delete [options]"
33
32
 
34
- opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
35
- options[:config] = config
36
- end
33
+ opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
34
+ options[:config] = config
35
+ end
37
36
 
38
- opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
39
- values[:group] = group
40
- end
37
+ opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
38
+ values[:group] = group
39
+ end
41
40
 
42
- opts.on('-h', '--help', I18n.t('option.help')) do
43
- puts opts
44
- exit 0
45
- end
41
+ opts.on('-h', '--help', I18n.t('option.help')) do
42
+ puts opts
43
+ exit 0
44
+ end
46
45
 
47
- opts.on('-n', '--no-sync', I18n.t('option.no_sync')) do
48
- options[:sync] = false
49
- end
46
+ opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
47
+ values[:pattern] = pattern
48
+ end
50
49
 
51
- opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
52
- values[:pattern] = pattern
53
- end
54
-
55
- opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
56
- options[:wallet] = wallet
57
- end
50
+ opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
51
+ options[:wallet] = wallet
52
+ end
58
53
  end.parse!
59
54
 
60
55
  config = MPW::Config.new(options[:config])
61
- cli = MPW::Cli.new(config, options[:sync])
56
+ cli = MPW::Cli.new(config)
62
57
 
63
58
  cli.load_config
64
59
  cli.get_wallet(options[:wallet])
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/ruby
2
2
  # MPW is a software to crypt and manage your passwords
3
- # Copyright (C) 2016 Adrien Waksberg <mpw@yae.im>
4
- #
3
+ # Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
4
+ #
5
5
  # This program is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU General Public License
7
7
  # as published by the Free Software Foundation; either version 2
8
8
  # of the License, or (at your option) any later version.
9
- #
9
+ #
10
10
  # This program is distributed in the hope that it will be useful,
11
11
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
  # GNU General Public License for more details.
14
- #
14
+ #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -24,45 +24,40 @@ require 'mpw/cli'
24
24
  # Options
25
25
  # --------------------------------------------------------- #
26
26
 
27
- options = {}
28
- options[:sync] = true
29
- values = {}
27
+ options = {}
28
+ values = {}
30
29
 
31
30
  OptionParser.new do |opts|
32
- opts.banner = "#{I18n.t('option.usage')}: mpw wallet [options]"
31
+ opts.banner = "#{I18n.t('option.usage')}: mpw wallet [options]"
33
32
 
34
- opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
35
- options[:config] = config
36
- end
33
+ opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
34
+ options[:config] = config
35
+ end
37
36
 
38
- opts.on('-f', '--file PATH', I18n.t('option.file_export')) do |file|
39
- options[:file] = file
40
- end
37
+ opts.on('-f', '--file PATH', I18n.t('option.file_export')) do |file|
38
+ options[:file] = file
39
+ end
41
40
 
42
- opts.on('-g', '--group GROUP', I18n.t('option.group')) do |group|
43
- values[:group] = group
44
- end
41
+ opts.on('-g', '--group GROUP', I18n.t('option.group')) do |group|
42
+ values[:group] = group
43
+ end
45
44
 
46
- opts.on('-h', '--help', I18n.t('option.help')) do
47
- puts opts
48
- exit 0
49
- end
45
+ opts.on('-h', '--help', I18n.t('option.help')) do
46
+ puts opts
47
+ exit 0
48
+ end
50
49
 
51
- opts.on('-n', '--no-sync', I18n.t('option.no_sync')) do
52
- options[:sync] = false
53
- end
50
+ opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
51
+ values[:pattern] = pattern
52
+ end
54
53
 
55
- opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
56
- values[:pattern] = pattern
57
- end
58
-
59
- opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
60
- options[:wallet] = wallet
61
- end
54
+ opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
55
+ options[:wallet] = wallet
56
+ end
62
57
  end.parse!
63
58
 
64
59
  config = MPW::Config.new(options[:config])
65
- cli = MPW::Cli.new(config, options[:sync])
60
+ cli = MPW::Cli.new(config)
66
61
 
67
62
  cli.load_config
68
63
  cli.get_wallet(options[:wallet])
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/ruby
2
2
  # MPW is a software to crypt and manage your passwords
3
- # Copyright (C) 2016 Adrien Waksberg <mpw@yae.im>
4
- #
3
+ # Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
4
+ #
5
5
  # This program is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU General Public License
7
7
  # as published by the Free Software Foundation; either version 2
8
8
  # of the License, or (at your option) any later version.
9
- #
9
+ #
10
10
  # This program is distributed in the hope that it will be useful,
11
11
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
  # GNU General Public License for more details.
14
- #
14
+ #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -22,29 +22,29 @@ require 'mpw/mpw'
22
22
  options = {}
23
23
 
24
24
  OptionParser.new do |opts|
25
- opts.banner = "#{I18n.t('option.usage')}: mpw passwd [options]"
25
+ opts.banner = "#{I18n.t('option.usage')}: mpw passwd [options]"
26
26
 
27
- opts.on('-h', '--help', I18n.t('option.help')) do
28
- puts opts
29
- exit 0
30
- end
27
+ opts.on('-h', '--help', I18n.t('option.help')) do
28
+ puts opts
29
+ exit 0
30
+ end
31
31
 
32
- opts.on('-l', '--length NUMBER', I18n.t('option.length')) do |length|
33
- options[:length] = length.to_i
34
- end
32
+ opts.on('-l', '--length NUMBER', I18n.t('option.length')) do |length|
33
+ options[:length] = length.to_i
34
+ end
35
35
 
36
- opts.on('-n', '--numeric', I18n.t('option.numeric')) do
37
- options[:numeric] = true
38
- end
36
+ opts.on('-n', '--numeric', I18n.t('option.numeric')) do
37
+ options[:numeric] = true
38
+ end
39
39
 
40
- opts.on('-s', '--special-chars', I18n.t('option.special_chars')) do
41
- options[:special] = true
42
- end
40
+ opts.on('-s', '--special-chars', I18n.t('option.special_chars')) do
41
+ options[:special] = true
42
+ end
43
43
 
44
- opts.on('-a', '--alpha', I18n.t('option.alpha')) do
45
- options[:alpha] = true
46
- end
44
+ opts.on('-a', '--alpha', I18n.t('option.alpha')) do
45
+ options[:alpha] = true
46
+ end
47
47
  end.parse!
48
48
 
49
- puts MPW::MPW::password(options)
49
+ puts MPW::MPW.password(options)
50
50
  exit 0
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/ruby
2
2
  # MPW is a software to crypt and manage your passwords
3
- # Copyright (C) 2016 Adrien Waksberg <mpw@yae.im>
4
- #
3
+ # Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
4
+ #
5
5
  # This program is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU General Public License
7
7
  # as published by the Free Software Foundation; either version 2
8
8
  # of the License, or (at your option) any later version.
9
- #
9
+ #
10
10
  # This program is distributed in the hope that it will be useful,
11
11
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
  # GNU General Public License for more details.
14
- #
14
+ #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -24,36 +24,31 @@ require 'mpw/cli'
24
24
  # Options
25
25
  # --------------------------------------------------------- #
26
26
 
27
- options = {}
28
- options[:sync] = true
27
+ options = {}
29
28
 
30
29
  OptionParser.new do |opts|
31
- opts.banner = "#{I18n.t('option.usage')}: mpw import [options]"
30
+ opts.banner = "#{I18n.t('option.usage')}: mpw import [options]"
32
31
 
33
- opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
34
- options[:config] = config
35
- end
32
+ opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
33
+ options[:config] = config
34
+ end
36
35
 
37
- opts.on('-f', '--file PATH', I18n.t('option.file_import')) do |file|
38
- options[:file] = file
39
- end
36
+ opts.on('-f', '--file PATH', I18n.t('option.file_import')) do |file|
37
+ options[:file] = file
38
+ end
40
39
 
41
- opts.on('-h', '--help', I18n.t('option.help')) do
42
- puts opts
43
- exit 0
44
- end
40
+ opts.on('-h', '--help', I18n.t('option.help')) do
41
+ puts opts
42
+ exit 0
43
+ end
45
44
 
46
- opts.on('-n', '--no-sync', I18n.t('option.no_sync')) do
47
- options[:sync] = false
48
- end
49
-
50
- opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
51
- options[:wallet] = wallet
52
- end
45
+ opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
46
+ options[:wallet] = wallet
47
+ end
53
48
  end.parse!
54
49
 
55
50
  config = MPW::Config.new(options[:config])
56
- cli = MPW::Cli.new(config, options[:sync])
51
+ cli = MPW::Cli.new(config)
57
52
 
58
53
  cli.load_config
59
54
  cli.get_wallet(options[:wallet])
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/ruby
2
2
  # MPW is a software to crypt and manage your passwords
3
- # Copyright (C) 2016 Adrien Waksberg <mpw@yae.im>
4
- #
3
+ # Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
4
+ #
5
5
  # This program is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU General Public License
7
7
  # as published by the Free Software Foundation; either version 2
8
8
  # of the License, or (at your option) any later version.
9
- #
9
+ #
10
10
  # This program is distributed in the hope that it will be useful,
11
11
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
  # GNU General Public License for more details.
14
- #
14
+ #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with this program; if not, write to the Free Software
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -24,41 +24,36 @@ require 'mpw/cli'
24
24
  # Options
25
25
  # --------------------------------------------------------- #
26
26
 
27
- options = {}
28
- options[:sync] = true
29
- values = {}
27
+ options = {}
28
+ values = {}
30
29
 
31
30
  OptionParser.new do |opts|
32
- opts.banner = "#{I18n.t('option.usage')}: mpw list [options]"
31
+ opts.banner = "#{I18n.t('option.usage')}: mpw list [options]"
33
32
 
34
- opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
35
- options[:config] = config
36
- end
33
+ opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
34
+ options[:config] = config
35
+ end
37
36
 
38
- opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
39
- values[:group] = group
40
- end
37
+ opts.on('-g', '--group NAME', I18n.t('option.group')) do |group|
38
+ values[:group] = group
39
+ end
41
40
 
42
- opts.on('-h', '--help', I18n.t('option.help')) do
43
- puts opts
44
- exit 0
45
- end
41
+ opts.on('-h', '--help', I18n.t('option.help')) do
42
+ puts opts
43
+ exit 0
44
+ end
46
45
 
47
- opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
48
- values[:pattern] = pattern
49
- end
46
+ opts.on('-p', '--pattern PATTERN', I18n.t('option.pattern')) do |pattern|
47
+ values[:pattern] = pattern
48
+ end
50
49
 
51
- opts.on('-n', '--no-sync', I18n.t('option.no_sync')) do
52
- options[:sync] = false
53
- end
54
-
55
- opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
56
- options[:wallet] = wallet
57
- end
50
+ opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
51
+ options[:wallet] = wallet
52
+ end
58
53
  end.parse!
59
54
 
60
55
  config = MPW::Config.new(options[:config])
61
- cli = MPW::Cli.new(config, options[:sync])
56
+ cli = MPW::Cli.new(config)
62
57
 
63
58
  cli.load_config
64
59
  cli.get_wallet(options[:wallet])