1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-10-27 02:33:19 +00:00

add setup option

This commit is contained in:
nishiki 2013-07-18 22:16:53 +02:00
parent 60eef298ce
commit e7776e3bc1
2 changed files with 10 additions and 1 deletions

2
Cli.rb
View file

@ -26,6 +26,8 @@ class Cli
# Create a new config file
def setup()
puts "# Setup a new config file"
puts "# --------------------"
key = ask("Enter the GPG key: ")
file_gpg = ask("Enter the path to encrypt file [default=#{Dir.home()}/.mpw.gpg]: ")
file_pwd = ask("Enter te path to password file [default=#{Dir.home()}/.mpw.pwd]: ")

9
mpw
View file

@ -35,6 +35,10 @@ OptionParser.new do |opts|
options[:add] = true
end
opts.on("-S", "--setup", "Setup the config file") do |b|
options[:setup] = true
end
opts.on("-s", "--ssh SEARCH", "Connect to ssh") do |search|
options[:ssh] = search
end
@ -56,7 +60,10 @@ end.parse!
cli = Cli.new()
# Display the item's informations
if not options[:display].nil?
if not options[:setup].nil?
cli.setup()
elsif not options[:display].nil?
if not options[:type].nil?
cli.display(options[:display], options[:type])
elsif not options[:showall].nil?