Skip to content

Commit 7c3ad62

Browse files
author
Chris Hunt
committed
Add option for GitHub host and keys path
1 parent e141b01 commit 7c3ad62

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/github/auth/cli.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
module Github::Auth
44
# Command Line Interface for parsing and executing commands
55
class CLI < Thor
6+
class_option :host, type: :string
7+
class_option :path, type: :string
8+
69
option :users, type: :array, required: true
710
option :command, type: :string
811
desc 'add', 'Add GitHub users to authorized keys'
@@ -104,11 +107,11 @@ def keys_file(options = {})
104107
end
105108

106109
def keys_file_path
107-
Github::Auth::KeysFile::DEFAULT_PATH
110+
options[:path] || Github::Auth::KeysFile::DEFAULT_PATH
108111
end
109112

110113
def github_hostname
111-
Github::Auth::KeysClient::DEFAULT_HOSTNAME
114+
options[:host] || Github::Auth::KeysClient::DEFAULT_HOSTNAME
112115
end
113116
end
114117
end

0 commit comments

Comments
 (0)