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.

72 lines
1.8 KiB

  1. # __________________________________________________________________________________
  2. #
  3. # Purpose:
  4. # PERL Script to emulate SLM's 'out' 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) and (!@DirList))
  35. {
  36. print "\n";
  37. print "Error: No files specified\n";
  38. print "\n";
  39. &Usage;
  40. exit 1;
  41. }
  42. system "$SourceControlClient sync @FileList @DirList > nul 2>&1 ";
  43. system "$SourceControlClient edit @FileList @DirList";
  44. sub Usage
  45. # __________________________________________________________________________________
  46. #
  47. # Prints out a usage statement for this script. In this case usurped from SLM's
  48. # 'status' usage statement
  49. #
  50. # Parameters:
  51. # None
  52. #
  53. # Output:
  54. # The usage statement
  55. #
  56. # __________________________________________________________________________________
  57. {
  58. print q/out - checks out project file(s)
  59. Usage: out [-?fhr] [file1] [file2...]
  60. Arguments:
  61. -h prints out this message.
  62. -r (recursive) applies the command to a specified directory and to every
  63. subdirectory under that directory. If no directory is specified in the
  64. file argument, the current directory is assumed.
  65. /;
  66. }