mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-22 02:40:04 +00:00
add option for otp
This commit is contained in:
parent
1edb10ae49
commit
8bcbffec66
1 changed files with 6 additions and 1 deletions
7
bin/mpw
7
bin/mpw
|
@ -48,6 +48,7 @@ I18n.locale = lang.to_sym
|
||||||
options_password = {}
|
options_password = {}
|
||||||
options = {}
|
options = {}
|
||||||
options[:force] = false
|
options[:force] = false
|
||||||
|
options[:otp] = false
|
||||||
options[:sync] = true
|
options[:sync] = true
|
||||||
options[:clipboard] = true
|
options[:clipboard] = true
|
||||||
options[:group] = nil
|
options[:group] = nil
|
||||||
|
@ -123,6 +124,10 @@ OptionParser.new do |opts|
|
||||||
options[:sync] = false
|
options[:sync] = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on('-O', '--otp', I18n.t('option.otp')) do
|
||||||
|
options[:otp] = true
|
||||||
|
end
|
||||||
|
|
||||||
opts.on('-s', '--show [SEARCH]', I18n.t('option.show')) do |search|
|
opts.on('-s', '--show [SEARCH]', I18n.t('option.show')) do |search|
|
||||||
search.nil? ? (options[:show] = '') : (options[:show] = search)
|
search.nil? ? (options[:show] = '') : (options[:show] = search)
|
||||||
end
|
end
|
||||||
|
@ -164,7 +169,7 @@ end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
config = MPW::Config.new(options[:config])
|
config = MPW::Config.new(options[:config])
|
||||||
cli = MPW::Cli.new(config, options[:clipboard], options[:sync])
|
cli = MPW::Cli.new(config, options[:clipboard], options[:sync], options[:otp])
|
||||||
|
|
||||||
# Setup a new config
|
# Setup a new config
|
||||||
if not options[:setup].nil?
|
if not options[:setup].nil?
|
||||||
|
|
Loading…
Add table
Reference in a new issue