Sha256: 97791d43139adde4c6d0bf350fda5211a608310e82a3fdf6a997c0f38bdc26d6

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

include GitP4Sync

options = {}

OptionParser.new do |opts|
  opts.banner = "Usage: git-p4-sync [options]"

  # opts.on("-b", "--branch [STRING]", String, "Git branch") do |o|
  #   options[:branch] = o || "master"
  # end

  opts.on("-g", "--git [STRING]", String, "Path to Git repository") do |o|
    options[:git] = o
  end
 
  opts.on("-p", "--p4 [STRING]", String, "Path to Perforce workspace directory") do |o|
    options[:p4] = o
  end

  opts.on("-P", "--pull", "Pull Git repository before processing") do |o|
    options[:pull] = o
  end

  opts.on("-S", "--submit", "Submit to Perforce after processing") do |o|
    options[:submit] = o
  end
  
  opts.on("-t", "--test", "Simulates a syncronisation without executing any command") do |o|
    options[:simulate] = o
  end
  
  opts.on("-i", "--ignore [STRING]", "Items to ignore. This is a colon ':' or comma ',' delimited list") do |o|
    options[:ignore] = o
  end
  
end.parse!

def error(msg)
  puts msg
  exit 1
end

error("Option --git required.") unless options[:git]
error("Option --p4 required.")  unless options[:p4]

run options

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
git-p4-sync-0.2.0 lib/start.rb
git-p4-sync-0.1.2 lib/start.rb