implement force option
This commit is contained in:
parent
d1674bc27a
commit
ccbf5a8acd
1 changed files with 21 additions and 6 deletions
19
mycp/mycp
19
mycp/mycp
|
|
@ -68,11 +68,22 @@ if ( $cvspath ) {
|
|||
next unless &inperms($_); # check if file perms are registered or make it so
|
||||
unless (&cmptocvs($_)) { # compare file to cvs
|
||||
print "$_ not in sync with cvs version\n";
|
||||
if ( $option{f} ) {
|
||||
print "cvs update forced\n";
|
||||
&cvsupdate($_);
|
||||
if ( $option{e} ) {
|
||||
&edit($_);
|
||||
unless (&cmptocvs($_)) {
|
||||
&cvsupdate($_);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print "please fix this\n";
|
||||
print "press enter to continue\n";
|
||||
my $line = <>;
|
||||
next;
|
||||
}
|
||||
}
|
||||
if ( $option{e} ) {
|
||||
&edit($_); # edit file
|
||||
unless (&cmptocvs($_)) { # if changed... then:
|
||||
|
|
@ -103,7 +114,7 @@ if ( $cvspath ) {
|
|||
}
|
||||
|
||||
sub cmdline {
|
||||
getopts("ehp", \%option);
|
||||
getopts("efhp", \%option);
|
||||
|
||||
if ( $option{h} ) { &help; }
|
||||
if ( scalar(@ARGV) == 0 ) { &help; }
|
||||
|
|
@ -389,7 +400,11 @@ sub slurp($) {
|
|||
sub help {
|
||||
print <<EOT;
|
||||
|
||||
Usage: mycp [-e] [-h] <file1> [file2] ...";
|
||||
Usage: mycp [-e] [-f] [-h] <file1> [file2] ...";
|
||||
|
||||
-e edit file
|
||||
-f force current version into cvs
|
||||
-h show this help message
|
||||
|
||||
EOT
|
||||
exit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue