Source code of Windows XP (NT5)
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.

75 lines
1.8 KiB

  1. # __________________________________________________________________________________
  2. #
  3. # Purpose:
  4. # PERL Script to emulate SLM's 'catsrc' command
  5. #
  6. # Parameters:
  7. # See Usage below
  8. #
  9. # Output:
  10. # Perforce output or the appropriate error message or usage statement
  11. #
  12. # __________________________________________________________________________________
  13. #
  14. # Load common SLM wrapper subroutine module
  15. #
  16. use SlmSubs;
  17. #
  18. # Parse command line arguments
  19. #
  20. SlmSubs::ParseArgs(@ARGV);
  21. #
  22. # Call usage and exit if ParseArgs has set the Usage or InvalidFlag flags or there
  23. # were no arguments given
  24. #
  25. if ($Usage or $InvalidFlag or $NoArgumentsGiven)
  26. {
  27. print $ErrorMessage;
  28. &Usage;
  29. exit 1;
  30. }
  31. #
  32. # Need to have a file list
  33. #
  34. if (!@FileList)
  35. {
  36. print "\n";
  37. print "Error: No files specified\n";
  38. print "\n";
  39. &Usage;
  40. exit 1;
  41. }
  42. system "$SourceControlClient print -q @FileList";
  43. sub Usage
  44. # __________________________________________________________________________________
  45. #
  46. # Prints out a usage statement for this script. In this case usurped from SLM's
  47. # 'status' usage statement
  48. #
  49. # Parameters:
  50. # None
  51. #
  52. # Output:
  53. # The usage statement
  54. #
  55. # __________________________________________________________________________________
  56. {
  57. print q/catsrc - prints current or previous versions of a source file
  58. Usage: catsrc [-?fhr] [file[#version](s)]
  59. Arguments:
  60. -h prints out this message.
  61. -r (recursive) retrieves all files in a given directory and in every
  62. subdirectory under that directory. If no directory is specified in the
  63. file argument, the current directory is assumed. If a file pattern is
  64. included, only retrieves files that match the pattern.
  65. file[#version](s)
  66. specifies the file or files to retrieve (each of which may have a
  67. version modifier).
  68. /;
  69. }