26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/copy_github_labels/cli.rb', line 26
def parse_args(args)
options = { override: false }
credentials = {}
OptionParser.new do |opts|
opts.banner = "Usage: copy_github_labels [OPTION]... SOURCE_REPO TARGET_REPO"
opts.on("-f", "--force", "Override existing labels") do
options[:override] = true
end
opts.on("-uUSERNAME", "--username==USERNAME", "GitHub username") do |username|
credentials[:login] = username
end
opts.on("-tTOKEN", "--token==TOKEN", "GitHub access token") do |token|
credentials[:access_token] = token
end
opts.on("-h", "--help", "Print help") do
puts opts
exit
end
end.parse!(args)
{
args: args,
credentials: credentials,
options: options
}
end
|