Skip to content

Commit e141b01

Browse files
author
Chris Hunt
committed
Remove usernames param from Cli#keys
1 parent ac84094 commit e141b01

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/github/auth/cli.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CLI < Thor
2222
LONGDESC
2323
def add
2424
on_keys_file :write!,
25-
"Adding #{keys(options[:users]).count} key(s) to '#{keys_file.path}'",
25+
"Adding #{keys.count} key(s) to '#{keys_file.path}'",
2626
{ command: options[:command] }
2727
end
2828

@@ -38,7 +38,7 @@ def add
3838
LONGDESC
3939
def remove
4040
on_keys_file :delete!,
41-
"Removing #{keys(options[:users]).count} key(s) from '#{keys_file.path}'"
41+
"Removing #{keys.count} key(s) from '#{keys_file.path}'"
4242
end
4343

4444
desc 'list', 'List all GitHub users already added to authorized keys'
@@ -60,8 +60,10 @@ def version
6060

6161
private
6262

63-
def keys(usernames = [])
64-
@keys ||= Array(usernames).map { |user| keys_for user }.flatten.compact
63+
def keys
64+
@keys ||= begin
65+
Array(options[:users]).map { |user| keys_for user }.flatten.compact
66+
end
6567
end
6668

6769
def on_keys_file(action, message, options = {})

0 commit comments

Comments
 (0)