Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB

  1. @rem = 'Perl from *.bat boilerplate
  2. @goto endofperl
  3. ';
  4. #------------------------------------------------------------------------------
  5. # This PERL script prints out a pretty-formatted log of yesterday's and today's
  6. # SLM changes by the current user from the current directory down.
  7. #------------------------------------------------------------------------------
  8. $username = $ENV{'LOGNAME'} || $ENV{'COMPUTERNAME'};
  9. foreach (`log -r -i -u $username -t.-1 -z 2>nul:`) {
  10. # Grab the information pieces from the status output line.
  11. ($time, $userid, $op, $file, $ver, $comment) = split (/[ \t]+/, $_, 6);
  12. $time =~ s/@/ /; # Zap '@' character.
  13. $file =~ s:\\:/:g; # Flip directory slashes.
  14. $op = 'checkin' if ($op eq 'in'); # Rename "in" op to "checkin"
  15. print "\n$op $file $ver $time\n";
  16. # Print the revision comment indented four spaces and wrapped at column 78.
  17. while (length($comment) > 74) {
  18. $comment =~ s/(.{1,74})\s+(.*)/$2/;
  19. print " $1\n";
  20. }
  21. print " $comment";
  22. }
  23. $file || print "No changes by user $username in the last 24 hours.\n";
  24. __END__
  25. #===============================================================================
  26. :endofperl
  27. @echo off
  28. set file=%0.bat
  29. set args=%1 %2 %3 %4 %5 %6 %7 %8 %9
  30. :loop
  31. shift
  32. set args=%args% %9
  33. if not "%9"=="" goto loop
  34. perl -S %file% %args%