mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-22 21:37:52 +00:00
fix show config
This commit is contained in:
parent
62318fe077
commit
8e4fb1c91b
2 changed files with 9 additions and 7 deletions
|
@ -105,7 +105,7 @@ module MPW
|
|||
'lang' => @config.lang,
|
||||
'gpg_key' => @config.gpg_key,
|
||||
'default_wallet' => @config.default_wallet,
|
||||
'config_dir' => @config.config_dir,
|
||||
'wallet_dir' => @config.wallet_dir,
|
||||
'pinmode' => @config.pinmode,
|
||||
'gpg_exe' => @config.gpg_exe
|
||||
}
|
||||
|
|
|
@ -58,11 +58,13 @@ module MPW
|
|||
wallet_dir = options[:wallet_dir] || @wallet_dir
|
||||
default_wallet = options[:default_wallet] || @default_wallet
|
||||
gpg_exe = options[:gpg_exe] || @gpg_exe
|
||||
pinmode = options[:pinmode] || @pinmode
|
||||
password = { numeric: true,
|
||||
alpha: true,
|
||||
special: false,
|
||||
length: 16 }
|
||||
pinmode = options.key?(:pinmode) ? options[:pinmode] : @pinmode
|
||||
password = {
|
||||
numeric: true,
|
||||
alpha: true,
|
||||
special: false,
|
||||
length: 16
|
||||
}
|
||||
|
||||
%w[numeric special alpha length].each do |k|
|
||||
if options.key?("pwd_#{k}".to_sym)
|
||||
|
@ -134,7 +136,7 @@ module MPW
|
|||
@default_wallet = config['default_wallet']
|
||||
@gpg_exe = config['gpg_exe']
|
||||
@password = config['password'] || {}
|
||||
@pinmode = config['pinmode']
|
||||
@pinmode = config['pinmode'] || false
|
||||
|
||||
raise if @gpg_key.empty? || @wallet_dir.empty?
|
||||
|
||||
|
|
Loading…
Reference in a new issue