mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-21 10:20:05 +00:00
add setup option
This commit is contained in:
parent
60eef298ce
commit
e7776e3bc1
2 changed files with 10 additions and 1 deletions
2
Cli.rb
2
Cli.rb
|
@ -26,6 +26,8 @@ class Cli
|
||||||
|
|
||||||
# Create a new config file
|
# Create a new config file
|
||||||
def setup()
|
def setup()
|
||||||
|
puts "# Setup a new config file"
|
||||||
|
puts "# --------------------"
|
||||||
key = ask("Enter the GPG key: ")
|
key = ask("Enter the GPG key: ")
|
||||||
file_gpg = ask("Enter the path to encrypt file [default=#{Dir.home()}/.mpw.gpg]: ")
|
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]: ")
|
file_pwd = ask("Enter te path to password file [default=#{Dir.home()}/.mpw.pwd]: ")
|
||||||
|
|
9
mpw
9
mpw
|
@ -35,6 +35,10 @@ OptionParser.new do |opts|
|
||||||
options[:add] = true
|
options[:add] = true
|
||||||
end
|
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|
|
opts.on("-s", "--ssh SEARCH", "Connect to ssh") do |search|
|
||||||
options[:ssh] = search
|
options[:ssh] = search
|
||||||
end
|
end
|
||||||
|
@ -56,7 +60,10 @@ end.parse!
|
||||||
cli = Cli.new()
|
cli = Cli.new()
|
||||||
|
|
||||||
# Display the item's informations
|
# 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?
|
if not options[:type].nil?
|
||||||
cli.display(options[:display], options[:type])
|
cli.display(options[:display], options[:type])
|
||||||
elsif not options[:showall].nil?
|
elsif not options[:showall].nil?
|
||||||
|
|
Loading…
Add table
Reference in a new issue