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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/redmine-installer/cli.rb', line 11
def self.start(argv)
program_desc I18n.translate(:redmine_installer_summary)
version Redmine::Installer::VERSION
desc I18n.translate(:cli_show_verbose_output)
default_value false
switch [:d, :v, :debug, :verbose], negatable: false
default_value 'en'
flag [:l, :locale]
pre do |global_options, command, options, args|
$verbose = global_options[:debug]
I18n.locale = global_options[:locale]
true
end
desc I18n.translate(:cli_install_desc)
arg :package
command [:i, :install] do |c|
c.flag [:s, :source], default_value: 'file',
must_match: ['file', 'git'],
desc: I18n.translate(:cli_flag_source)
c.flag [:b, :branch], default_value: 'master',
desc: I18n.translate(:cli_flag_branch)
c.flag [:e, :env, :environment], default_value: ['production'],
desc: I18n.translate(:cli_flag_environment),
type: Array
c.action do |global_options, options, args|
run_action('install', args.first, options)
end
end
desc I18n.translate(:cli_upgrade_desc)
arg :package
command [:u, :upgrade] do |c|
c.flag [:p, :profile]
c.flag [:s, :source], default_value: 'file',
must_match: ['file', 'git'],
desc: I18n.translate(:cli_flag_source)
c.flag [:e, :env, :environment], default_value: ['production'],
desc: I18n.translate(:cli_flag_environment),
type: Array
c.switch 'skip-old-modifications', default_value: false
c.action do |global_options, options, args|
run_action('upgrade', args.first, options)
end
end
desc I18n.translate(:cli_backup_desc)
arg :redmine_root
command [:b, :backup] do |c|
c.flag [:p, :profile]
c.action do |global_options, options, args|
run_action('backup', args.first, options)
end
end
run(argv)
end
|