diff --git a/lib/twik/cli/config.rb b/lib/twik/cli/config.rb index 48d2199..c3188c0 100644 --- a/lib/twik/cli/config.rb +++ b/lib/twik/cli/config.rb @@ -10,6 +10,7 @@ class Twik def self.default { + 'default_profile' => 'default', 'profiles' => { 'default' => { 'privatekey' => Twik::PrivateKey.generate, @@ -41,7 +42,7 @@ class Twik end def profile - args['profile'] || 'default' + args['profile'] || yaml['default_profile'] || 'default' end def options diff --git a/lib/twik/cli/options.rb b/lib/twik/cli/options.rb index 93402ba..5fdd5b7 100644 --- a/lib/twik/cli/options.rb +++ b/lib/twik/cli/options.rb @@ -12,16 +12,16 @@ class Twik opts.separator '' opts.separator 'Specific options:' - opts.on('-l', '--length LENGTH', 'length of generated password (4-26). Default: 16') do |length| + opts.on('-l', '--length LENGTH', 'length of generated password (4-26)') do |length| options['length'] = length.to_i end - opts.on('-p', '--profile PROFILE', "profile to use. Default: 'default'") do |profile| + opts.on('-p', '--profile PROFILE', "profile to use") do |profile| options['profile'] = profile end opts.on('-t', '--type TYPE', Twik::TYPE, - "type of password:", " #{Twik::TYPE.join(', ')}", " Default: alphanumeric_and_special_chars") do |type| + "type of password:", " #{Twik::TYPE.join(', ')}") do |type| options['type'] = type.to_sym end