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.

91 lines
2.3 KiB

  1. # __________________________________________________________________________________
  2. #
  3. # Purpose:
  4. # PERL Script to emulate SLM's 'enlist' 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
  23. #
  24. if ($Usage or $InvalidFlag)
  25. {
  26. print $ErrorMessage;
  27. &Usage;
  28. exit 1;
  29. }
  30. #
  31. # Set @CurrentClientList equal to $SourceControlClient client output
  32. #
  33. open(CLIENTS, "$SourceControlClient clients |");
  34. @ClientsOutput = <CLIENTS>;
  35. close (CLIENTS);
  36. foreach $ClientLine (@ClientsOutput)
  37. {
  38. $ClientLine =~ /^Client (\S+) .*/;
  39. $ClientName = $1;
  40. push @ClientsList, $ClientName;
  41. }
  42. foreach $ClientName (@ClientsList)
  43. {
  44. my @OwnerClientList;
  45. #
  46. # Set @CurrentClientList equal to $SourceControlClient client output
  47. #
  48. open(CLIENT, "$SourceControlClient -c $ClientName client -o |");
  49. # open(CLIENT, "$SourceControlClient -c DANIELLI2K--f:\\mpc client -o |");
  50. @ClientOutput = <CLIENT>;
  51. close (CLIENT);
  52. &SlmSubs::CleanUpList(\@ClientOutput);
  53. print "@ClientOutput";
  54. }
  55. sub Usage
  56. # __________________________________________________________________________________
  57. #
  58. # Prints out a usage statement for this script. In this case usurped from SLM's
  59. # 'enlist' usage statement
  60. #
  61. # Parameters:
  62. # None
  63. #
  64. # Output:
  65. # The usage statement
  66. #
  67. # __________________________________________________________________________________
  68. {
  69. print q/enlist - enlists a directory in a project
  70. Usage: enlist [-?fh] [-s Server:Port] -p [branch]\/projname
  71. Arguments:
  72. -h prints out this message.
  73. -p use this flag to specify the name of the project to enlist in. The
  74. project name can be preceeded by a branch name. The default branch
  75. is the main branch.
  76. -s use this flag to specify the network location of the project in which
  77. to enlist, using the format: -s Server:Port "Server" is the network
  78. server name and "Port" is the Perforce Server's TCP\/IP port number.
  79. /;
  80. }