Sha256: f92eb3673628a4b5b7621a97a7c55a9284dd4f1d0e2fb6c4726e54c01e16185d
Contents?: true
Size: 927 Bytes
Versions: 4
Compression:
Stored size: 927 Bytes
Contents
command :copy do |c| c.workflow :hg c.desc "Copies a file from one location to another, while maintaining history" c.opt :force, "Forces the copy, ignoring overwrites", :short => "-f" c.opt :"dry-run", "Doesn't actually move files - only prints what would happen", :short => "-n" c.opt :verbose, "Prints more output than normal", :short => "-v" c.synonym :cp c.before do |opts, args| if args.size < 2 Amp::UI.say "Usage: amp copy source [other-sources...] destination" c.break elsif args.size > 2 && !File.directory?(args.last) Amp::UI.say "If you want to copy more than 1 file, your destination must" + " be a directory." c.break end true end c.on_run do |opts, args| repo = opts[:repository] sources = args[0..-2] destination = args.last sources.each do |source| repo.copy source, destination, opts end end end
Version data entries
4 entries across 4 versions & 2 rubygems