-
Notifications
You must be signed in to change notification settings - Fork 245
/
Copy pathtools.rb
40 lines (33 loc) · 1017 Bytes
/
tools.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'claide'
module XcodeInstall
class Command
class Tools < Command
self.command = 'tools'
self.summary = 'List or install Xcode CLI tools.'
def self.options
[['--install=name', 'Install CLI tools with the name specified'],
['--force', 'Install even if the same version is already installed.'],
['--no-install', 'Only download DMG, but do not install it.'],
['--no-progress', 'Don’t show download progress.']].concat(super)
end
def initialize(argv)
@install = argv.option('install')
@force = argv.flag?('force', false)
@should_install = argv.flag?('install', true)
@progress = argv.flag?('progress', true)
@installer = XcodeInstall::Installer.new
super
end
def run
@install ? install : list
end
:private
def install
@installer.install_tools(@install)
end
def list
puts @installer.toolslist
end
end
end
end