Method: RIM::Command::Sync#initialize

Defined in:
lib/rim/command/sync.rb

#initialize(opts) ⇒ Sync

Returns a new instance of Sync.



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
# File 'lib/rim/command/sync.rb', line 15

def initialize(opts)
  opts.banner = "Usage: rim sync [<options>] [<local_module_path>]"
  opts.description = "Synchronize specified rim modules with remote repository revisions."
  opts.separator ""
  opts.on("-m", "--manifest [MANIFEST]", String, "Read information from manifest.", \
                                                 "If no manifest file is specified a 'manifest.rim' file will be used.") do |manifest|
    @manifest = manifest ? manifest : Helpers::default_manifest
  end
  opts.on("-c", "--create", "Synchronize module initially to <local_module_path>.", \
                            "Specify the remote URL and the target revision with the options.") do
    @create = true
  end
  opts.on("-a", "--all", "Collects all modules from the specified paths.") do
    @all = true
  end
  opts.on("-e", "--exclude PATTERN_LIST", String, "Exclude all modules of a comma separated list of directories when using sync with -a option.") do |dirlist|
    @excludedirs = dirlist.split(",")
  end
  @module_options = {}
  opts.on("-u", "--remote-url URL", String, "Set the remote URL of the module.", \
                                            "A relative path will be applied to ssh://gerrit/") do |url|
    @module_options[:remote_url] = url 
  end 
  opts.on("-r", "--target-revision REVISION", String, "Set the target revision of the module.") do |target_revision|
    @module_options[:target_revision] = target_revision
  end
  opts.on("-i", "--ignore PATTERN_LIST", String, "Set the ignore patterns by specifying a comma separated list.") do |ignores|
    @module_options[:ignores] = ignores || ""
  end
  opts.on("-m", "--message MESSAGE", String, "Message header to provide to each commit.") do |message|
    @message = message
  end
  opts.on("-d", "--subdir [SUBDIR]", String, "Sync just a subdir from the remote module.") do |subdir|
    @module_options[:subdir] = subdir || ''
  end
  opts.on("-s", "--split", "Create a separate commit for each module.") do
    @split = true
  end
  opts.on("-b", "--rebase", "Rebase after successful sync.") do
    @rebase = true
  end
end