mpw 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 449a8603fbd577dd5cb93ef7beefb0b8e9c45825
4
- data.tar.gz: 763ee9163b7d0abac719853bdf48fa3b4a10ec7d
3
+ metadata.gz: 81608d9969c62b9a2d545b091e85e11e036d0fb6
4
+ data.tar.gz: ca92f9c9b5626d72af12dc5aaa9914376acd790e
5
5
  SHA512:
6
- metadata.gz: f843a0c0918d63864f01c7929736f75f60bbe97ac3de0b0588b10bc90b50e87abf7f155622653c19947caa11648ac1147e88a38ff8a8756593020fb976d10d50
7
- data.tar.gz: 571dc0eb3daa1d425f4ceae5137f1cfc41017828335d6b8fe081428c9d6bd7713badfee3cec0cc49fe45512305bcb176555c6c412c1dc8e13100b35e609b14e5
6
+ metadata.gz: e3c92de6bfbacbf52b143ce155795a544c987fc4ea683eb2dc43158f82035e6c33e2ae046dc90d3f12d1201c38c73298d94e71d01bbe96db7ebbf3bf37514864
7
+ data.tar.gz: '004278306d45d232007ff259a39b219899f1590c2000fccf864ea80d30dfaa060c6a36eeaab65348b212c766339acd61337d94bd9538c46318752e0e905e2e04'
@@ -0,0 +1,122 @@
1
+
2
+ AllCops:
3
+ Exclude:
4
+ - db/**/*
5
+ - config/**/*
6
+ - test/*
7
+ - Vagrantfile
8
+ TargetRubyVersion: 2.3
9
+
10
+ Style/AccessorMethodName:
11
+ Enabled: false
12
+ Style/NumericLiteralPrefix:
13
+ Enabled: false
14
+ Style/TrailingCommaInArguments:
15
+ Enabled: false
16
+ Style/TrailingCommaInLiteral:
17
+ Enabled: false
18
+ Style/FrozenStringLiteralComment:
19
+ Enabled: false
20
+ Metrics/ParameterLists:
21
+ Max: 5
22
+ CountKeywordArgs: false
23
+ Style/MutableConstant:
24
+ Enabled: false
25
+ Metrics/LineLength:
26
+ Max: 120
27
+ Metrics/AbcSize:
28
+ Enabled: false
29
+ Metrics/MethodLength:
30
+ Enabled: false
31
+ Metrics/BlockLength:
32
+ Enabled: false
33
+ Metrics/CyclomaticComplexity:
34
+ Enabled: false
35
+ Metrics/PerceivedComplexity:
36
+ Enabled: false
37
+ Metrics/ClassLength:
38
+ Enabled: false
39
+ Style/SpaceInsideHashLiteralBraces:
40
+ Enabled: false
41
+ Style/AsciiComments:
42
+ Enabled: true
43
+ Style/Documentation:
44
+ Enabled: false
45
+ Style/SignalException:
46
+ Enabled: false
47
+ Style/OptionHash:
48
+ Enabled: true
49
+ Style/SymbolArray:
50
+ Enabled: true
51
+ Performance/Casecmp:
52
+ Enabled: false
53
+ Style/DoubleNegation:
54
+ Enabled: false
55
+ Style/Alias:
56
+ EnforcedStyle: prefer_alias_method
57
+ Style/MultilineMethodCallIndentation:
58
+ EnforcedStyle: indented
59
+ Style/RaiseArgs:
60
+ EnforcedStyle: exploded
61
+ Style/SpaceInLambdaLiteral:
62
+ Enabled: false
63
+ Lint/UnneededSplatExpansion:
64
+ Enabled: false
65
+
66
+
67
+ # Generated configuration
68
+ Style/HashSyntax:
69
+ Enabled: true
70
+ EnforcedStyle: ruby19
71
+ UseHashRocketsWithSymbolValues: false
72
+ Style/MethodDefParentheses:
73
+ Enabled: true
74
+ EnforcedStyle: require_parentheses
75
+ Style/MultilineAssignmentLayout:
76
+ Enabled: true
77
+ EnforcedStyle: new_line
78
+ Style/IndentationConsistency:
79
+ Enabled: true
80
+ EnforcedStyle: normal
81
+ Style/AlignParameters:
82
+ Enabled: true
83
+ EnforcedStyle: with_fixed_indentation
84
+ Style/BlockDelimiters:
85
+ Enabled: true
86
+ EnforcedStyle: line_count_based
87
+ Style/AndOr:
88
+ Enabled: true
89
+ Style/DotPosition:
90
+ Enabled: true
91
+ EnforcedStyle: leading
92
+ Style/EmptyLinesAroundClassBody:
93
+ Enabled: true
94
+ EnforcedStyle: no_empty_lines
95
+ Style/EmptyLinesAroundModuleBody:
96
+ Enabled: true
97
+ EnforcedStyle: no_empty_lines
98
+ Style/NumericPredicate:
99
+ Enabled: true
100
+ EnforcedStyle: comparison
101
+ Style/EvenOdd:
102
+ Enabled: false
103
+ Style/CollectionMethods:
104
+ Enabled: true
105
+ PreferredMethods:
106
+ collect: map
107
+ collect!: map!
108
+ inject: reduce
109
+ detect: find
110
+ find_all: select
111
+ Style/EmptyLinesAroundAccessModifier:
112
+ Enabled: true
113
+ Style/CommandLiteral:
114
+ Enabled: true
115
+ EnforcedStyle: percent_x
116
+ Style/StringLiterals:
117
+ Enabled: true
118
+ EnforcedStyle: single_quotes
119
+ Style/SpaceInsideBlockBraces:
120
+ EnforcedStyle: space
121
+ Style/VariableNumber:
122
+ EnforcedStyle: snake_case
@@ -7,8 +7,10 @@ rvm:
7
7
  install:
8
8
  - bundle install
9
9
  - gem install 'test-unit'
10
+ - gem install rubocop
10
11
  - echo 9999 > VERSION
11
12
  - gem build mpw.gemspec
12
13
  - gem install mpw-9999.gem
13
14
  script:
15
+ - rubocop
14
16
  - ruby ./test/tests.rb
@@ -1,4 +1,13 @@
1
1
  # CHANGELOG
2
+ ## v4.1.0
3
+
4
+ * feat: add options to update or add an item in command line
5
+ * feat: print config
6
+ * feat: add a specific path for a wallet
7
+ * feat: add rubocop to fix syntax
8
+ * fix: pinentry mode with gpg >= 2.1
9
+ * remove SSH and FTP synchronization
10
+
2
11
  ## v4.0.0
3
12
 
4
13
  * feature: set default wallet
data/Gemfile CHANGED
@@ -1,10 +1,8 @@
1
1
  source 'https://rubygems.org'
2
- gem "i18n", "~> 0.7", ">= 0.7.0"
3
- gem "gpgme", "~> 2.0", ">= 2.0.12"
4
- gem "highline", "~> 1.7", ">= 1.7.8"
5
- gem "locale", "~> 2.1", ">= 2.1.2"
6
- gem "colorize", "~> 0.8", ">= 0.8.1"
7
- gem "net-ssh", "~> 3.2", ">= 3.2.0"
8
- gem "net-sftp", "~> 2.1", ">= 2.1.2"
9
- gem "clipboard", "~> 1.1", ">= 1.1.1"
10
- gem "rotp", "~> 3.1", ">= 3.1.0"
2
+ gem 'clipboard', '~> 1.1', '>= 1.1.1'
3
+ gem 'colorize', '~> 0.8', '>= 0.8.1'
4
+ gem 'gpgme', '~> 2.0', '>= 2.0.12'
5
+ gem 'highline', '~> 1.7', '>= 1.7.8'
6
+ gem 'i18n', '~> 0.7', '>= 0.7.0'
7
+ gem 'locale', '~> 2.1', '>= 2.1.2'
8
+ gem 'rotp', '~> 3.1', '>= 3.1.0'
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # MPW: Manage your passwords!
2
- [![Version](https://img.shields.io/badge/latest_version-4.0.0-green.svg)](https://github.com/nishiki/manage-password/releases)
2
+ [![Version](https://img.shields.io/badge/latest_version-4.1.0-green.svg)](https://github.com/nishiki/manage-password/releases)
3
3
  [![Build Status](https://travis-ci.org/nishiki/manage-password.svg?branch=master)](https://travis-ci.org/nishiki/manage-password)
4
4
  [![License](https://img.shields.io/badge/license-GPL--2.0-blue.svg)](https://github.com/nishiki/manage-password/blob/master/LICENSE)
5
5
 
@@ -11,7 +11,6 @@ mpw is a little software which stores your passwords in [GnuPG](http://www.gnupg
11
11
  * generate OTP code
12
12
  * copy your login, password or otp in clipboard
13
13
  * manage many wallets
14
- * synchronize your passwords with SSH or FTP.
15
14
  * share a wallet with others GPG keys
16
15
 
17
16
  ## Install
@@ -105,11 +104,6 @@ Remove a GPG key:
105
104
  mpw wallet --delete-gpg-key test42@localhost.com
106
105
  ```
107
106
 
108
- Add synchronize:
109
- ```
110
- mpw wallet --protocol ssh --host example.com --user test --path /remote/path --password
111
- ```
112
-
113
107
  ### Export and import data
114
108
 
115
109
  You can export your data in yaml file with your passwords in clear text:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.0
1
+ 4.1.0
data/bin/mpw CHANGED
@@ -1,22 +1,22 @@
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.
18
18
 
19
- $: << File.expand_path('../../lib', __FILE__)
19
+ $LOAD_PATH << File.expand_path('../../lib', __FILE__)
20
20
 
21
21
  require 'locale'
22
22
  require 'set'
@@ -30,7 +30,7 @@ require 'colorize'
30
30
  lang = Locale::Tag.parse(ENV['LANG']).to_simple.to_s[0..1]
31
31
 
32
32
  if defined?(I18n.enforce_available_locales)
33
- I18n.enforce_available_locales = true
33
+ I18n.enforce_available_locales = true
34
34
  end
35
35
 
36
36
  I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
@@ -45,25 +45,25 @@ I18n.locale = lang.to_sym
45
45
  bin_dir = File.dirname(__FILE__)
46
46
  command = "#{bin_dir}/mpw-#{ARGV[0]}"
47
47
 
48
- if Dir.glob("#{bin_dir}/mpw-*").include?("#{command}")
49
- begin
50
- Kernel.load(command)
51
- rescue OptionParser::ParseError => e
52
- puts "#{I18n.t('display.error')}: #{e}".red
53
- end
48
+ if Dir.glob("#{bin_dir}/mpw-*").include?(command.to_s)
49
+ begin
50
+ Kernel.load(command)
51
+ rescue OptionParser::ParseError => e
52
+ puts "#{I18n.t('display.error')}: #{e}".red
53
+ end
54
54
  else
55
- puts "#{I18n.t('option.usage')}: mpw COMMAND [options]\n\n"
56
- puts 'Commands:'
57
- puts " add #{I18n.t('command.add')}"
58
- puts " config #{I18n.t('command.config')}"
59
- puts " copy #{I18n.t('command.copy')}"
60
- puts " delete #{I18n.t('command.delete')}"
61
- puts " export #{I18n.t('command.export')}"
62
- puts " genpwd #{I18n.t('command.genpwd')}"
63
- puts " import #{I18n.t('command.import')}"
64
- puts " list #{I18n.t('command.list')}"
65
- puts " update #{I18n.t('command.update')}"
66
- puts " wallet #{I18n.t('command.wallet')}"
55
+ puts "#{I18n.t('option.usage')}: mpw COMMAND [options]\n\n"
56
+ puts 'Commands:'
57
+ puts " add #{I18n.t('command.add')}"
58
+ puts " config #{I18n.t('command.config')}"
59
+ puts " copy #{I18n.t('command.copy')}"
60
+ puts " delete #{I18n.t('command.delete')}"
61
+ puts " export #{I18n.t('command.export')}"
62
+ puts " genpwd #{I18n.t('command.genpwd')}"
63
+ puts " import #{I18n.t('command.import')}"
64
+ puts " list #{I18n.t('command.list')}"
65
+ puts " update #{I18n.t('command.update')}"
66
+ puts " wallet #{I18n.t('command.wallet')}"
67
67
 
68
- exit 3
68
+ exit 3
69
69
  end
@@ -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,38 +24,67 @@ require 'mpw/cli'
24
24
  # Options
25
25
  # --------------------------------------------------------- #
26
26
 
27
- options = {}
28
- options[:sync] = true
27
+ values = {}
28
+ options = {}
29
+ options[:text_editor] = true
29
30
 
30
31
  OptionParser.new do |opts|
31
- opts.banner = "#{I18n.t('option.usage')}: mpw add [options]"
32
+ opts.banner = "#{I18n.t('option.usage')}: mpw add [options]"
32
33
 
33
- opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
34
- options[:config] = config
35
- end
34
+ opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
35
+ options[:config] = config
36
+ end
36
37
 
37
- opts.on('-h', '--help', I18n.t('option.help')) do
38
- puts opts
39
- exit 0
40
- end
38
+ opts.on('-C', '--comment COMMENT', I18n.t('option.comment')) do |comment|
39
+ values[:comment] = comment
40
+ end
41
41
 
42
- opts.on('-n', '--no-sync', I18n.t('option.no_sync')) do
43
- options[:sync] = false
44
- end
42
+ opts.on('-G', '--group NAME', I18n.t('option.new_group')) do |group|
43
+ values[:group] = group
44
+ end
45
45
 
46
- opts.on('-r', '--random', I18n.t('option.random_password')) do
47
- options[:password] = true
48
- end
46
+ opts.on('-h', '--help', I18n.t('option.help')) do
47
+ puts opts
48
+ exit 0
49
+ end
49
50
 
50
- opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
51
- options[:wallet] = wallet
52
- end
51
+ opts.on('-H', '--host HOST', I18n.t('option.host')) do |host|
52
+ values[:host] = host
53
+ end
54
+
55
+ opts.on('-o', '--otp-code CODE', I18n.t('option.otp_code')) do |otp|
56
+ values[:otp_key] = otp
57
+ end
58
+
59
+ opts.on('-O', '--protocol PROTOCOL', I18n.t('option.protocol')) do |protocol|
60
+ values[:protocol] = protocol
61
+ end
62
+
63
+ opts.on('-P', '--port NUMBER', I18n.t('option.port')) do |port|
64
+ values[:port] = port
65
+ end
66
+
67
+ opts.on('-r', '--random', I18n.t('option.random_password')) do
68
+ options[:password] = true
69
+ end
70
+
71
+ opts.on('-t', '--text-editor', I18n.t('option.text_editor')) do
72
+ options[:text_editor] = true
73
+ end
74
+
75
+ opts.on('-u', '--user USER', I18n.t('option.user')) do |user|
76
+ values[:user] = user
77
+ end
78
+
79
+ opts.on('-w', '--wallet NAME', I18n.t('option.wallet')) do |wallet|
80
+ options[:wallet] = wallet
81
+ end
53
82
  end.parse!
54
83
 
55
84
  config = MPW::Config.new(options[:config])
56
- cli = MPW::Cli.new(config, options[:sync])
85
+ cli = MPW::Cli.new(config)
57
86
 
58
87
  cli.load_config
59
88
  cli.get_wallet(options[:wallet])
60
89
  cli.decrypt
61
- cli.add(options[:password])
90
+ cli.add(options[:password], options[:text_editor], values)
@@ -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.
@@ -28,81 +28,93 @@ options = {}
28
28
  values = {}
29
29
 
30
30
  OptionParser.new do |opts|
31
- opts.banner = "#{I18n.t('option.usage')}: mpw config [options]"
31
+ opts.banner = "#{I18n.t('option.usage')}: mpw config [options]"
32
32
 
33
- opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
34
- options[:config] = config
35
- end
33
+ opts.on('-c', '--config PATH', I18n.t('option.config')) do |config|
34
+ options[:config] = config
35
+ end
36
36
 
37
- opts.on('-d', '--default-wallet NAME', I18n.t('option.default_wallet')) do |default_wallet|
38
- values[:default_wallet] = default_wallet
39
- end
37
+ opts.on('-d', '--default-wallet NAME', I18n.t('option.default_wallet')) do |default_wallet|
38
+ values[:default_wallet] = default_wallet
39
+ end
40
40
 
41
- opts.on('-g', '--gpg-exe PATH', I18n.t('option.gpg_exe')) do |gpg_exe|
42
- values[:gpg_exe] = gpg_exe
43
- end
41
+ opts.on('-g', '--gpg-exe PATH', I18n.t('option.gpg_exe')) do |gpg_exe|
42
+ values[:gpg_exe] = gpg_exe
43
+ end
44
44
 
45
- opts.on('-h', '--help', I18n.t('option.help')) do
46
- puts opts
47
- exit 0
48
- end
45
+ opts.on('-h', '--help', I18n.t('option.help')) do
46
+ puts opts
47
+ exit 0
48
+ end
49
49
 
50
- opts.on('-i', '--init GPG_KEY', I18n.t('option.init')) do |gpg_key|
51
- options[:init] = true
52
- values[:gpg_key] = gpg_key
53
- end
50
+ opts.on('-i', '--init GPG_KEY', I18n.t('option.init')) do |gpg_key|
51
+ options[:init] = true
52
+ values[:gpg_key] = gpg_key
53
+ end
54
54
 
55
- opts.on('-k', '--key GPG_KEY', I18n.t('option.gpg_key')) do |gpg_key|
56
- values[:gpg_key] = gpg_key
57
- end
55
+ opts.on('-k', '--key GPG_KEY', I18n.t('option.gpg_key')) do |gpg_key|
56
+ values[:gpg_key] = gpg_key
57
+ end
58
58
 
59
- opts.on('-L', '--lang LANG', I18n.t('option.lang')) do |lang|
60
- values[:lang] = lang
61
- end
59
+ opts.on('-L', '--lang LANG', I18n.t('option.lang')) do |lang|
60
+ values[:lang] = lang
61
+ end
62
62
 
63
- opts.on('-w', '--wallet-dir PATH', I18n.t('option.wallet_dir')) do |wallet_dir|
64
- values[:wallet_dir] = wallet_dir
65
- end
63
+ opts.on('-P', '--enable-pinmode', I18n.t('option.pinmode')) do
64
+ values[:pinmode] = true
65
+ end
66
66
 
67
- opts.on('-l', '--length NUMBER', I18n.t('option.length')) do |length|
68
- values[:pwd_length] = length.to_i
69
- end
67
+ opts.on('-p', '--disable-pinmode', I18n.t('option.disable_pinmode')) do
68
+ values[:pinmode] = false
69
+ end
70
70
 
71
- opts.on('-n', '--numeric', I18n.t('option.numeric')) do
72
- values[:pwd_numeric] = true
73
- end
71
+ opts.on('-w', '--wallet-dir PATH', I18n.t('option.wallet_dir')) do |wallet_dir|
72
+ values[:wallet_dir] = wallet_dir
73
+ end
74
74
 
75
- opts.on('-N', '--disable-numeric', I18n.t('option.disable_numeric')) do
76
- values[:pwd_numeric] = false
77
- end
75
+ opts.on('-l', '--length NUMBER', I18n.t('option.length')) do |length|
76
+ values[:pwd_length] = length.to_i
77
+ end
78
78
 
79
- opts.on('-s', '--special-chars', I18n.t('option.special_chars')) do
80
- values[:pwd_special] = true
81
- end
79
+ opts.on('-n', '--numeric', I18n.t('option.numeric')) do
80
+ values[:pwd_numeric] = true
81
+ end
82
82
 
83
- opts.on('-S', '--disable_special-chars', I18n.t('option.special_chars')) do
84
- values[:pwd_special] = false
85
- end
83
+ opts.on('-N', '--disable-numeric', I18n.t('option.disable_numeric')) do
84
+ values[:pwd_numeric] = false
85
+ end
86
86
 
87
- opts.on('-a', '--alpha', I18n.t('option.alpha')) do
88
- values[:pwd_alpha] = true
89
- end
87
+ opts.on('-s', '--special-chars', I18n.t('option.special_chars')) do
88
+ values[:pwd_special] = true
89
+ end
90
90
 
91
- opts.on('-A', '--disable-alpha', I18n.t('option.disable_alpha')) do
92
- values[:pwd_alpha] = false
93
- end
91
+ opts.on('-S', '--disable_special-chars', I18n.t('option.special_chars')) do
92
+ values[:pwd_special] = false
93
+ end
94
+
95
+ opts.on('-a', '--alpha', I18n.t('option.alpha')) do
96
+ values[:pwd_alpha] = true
97
+ end
98
+
99
+ opts.on('-A', '--disable-alpha', I18n.t('option.disable_alpha')) do
100
+ values[:pwd_alpha] = false
101
+ end
94
102
  end.parse!
95
103
 
96
104
  config = MPW::Config.new(options[:config])
97
- cli = MPW::Cli.new(config, nil)
98
-
99
- if options.has_key?(:init)
100
- cli.setup(values)
101
- cli.load_config
102
- cli.get_wallet
103
- cli.setup_gpg_key(values[:gpg_key])
104
- cli.setup_wallet_config
105
+ cli = MPW::Cli.new(config)
106
+
107
+ if options.key?(:init)
108
+ cli.setup(values)
109
+ cli.load_config
110
+ cli.get_wallet
111
+ cli.setup_gpg_key(values[:gpg_key])
112
+ cli.setup_wallet_config
105
113
  else
106
- cli.load_config
107
- cli.set_config(values)
114
+ cli.load_config
115
+ if values.empty?
116
+ cli.list_config
117
+ else
118
+ cli.set_config(values)
119
+ end
108
120
  end