The Artima Developer Community
Sponsored Link

Java Buzz Forum
cvs udpate -dP

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Brian McCallister

Posts: 1282
Nickname: frums
Registered: Sep, 2003

Brian McCallister is JustaProgrammer who thinks too much.
cvs udpate -dP Posted: Jan 13, 2004 9:12 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Brian McCallister.
Original Post: cvs udpate -dP
Feed Title: Waste of Time
Feed URL: http://kasparov.skife.org/blog/index.rss
Feed Description: A simple waste of time and weblog experiment
Latest Java Buzz Posts
Latest Java Buzz Posts by Brian McCallister
Latest Posts From Waste of Time

Advertisement

I have done a brief survey of the developers I work with and discovered that what I had attributed to (mild) undiagnosed dyslexia in myself is really a very common typo. Apparently lots of people use cvs udpate quite frequently. So, in honor of the cvs udpaters out there:


#!/usr/bin/env ruby
#
# =Usage
# Replace value of REAL_CVS with the full path to the real cvs executable
# and then rename this file to 'cvs' and place it in a directory in your
# PATH which will be searched before the one containing the real cvs binary
#
# You can modify the speling hash to correct things for you =)
#
REAL_CVS='/usr/bin/cvs'

speling = 
{
    'udpate' => 'update'
}

line = "#{REAL_CVS} #{ARGV.join(' ')}"
speling.each { |key, value| line.gsub!(Regexp.compile(key), value)}
Kernel.exec(line)

A better implementation would parse out cvs options correctly to make sure that it didn't "fix" any filenames in the command line.

Read: cvs udpate -dP

Topic: Eric Gamma on the future of Eclipse Previous Topic   Next Topic Topic: Trackback Definition - discussions on one way trackbacking

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use