#! /usr/bin/perl # # NAME: labellist.pl # DESC: Shows list of labels for selected depot path (labels with tagged files) # P4V Custom Tool Setup: ## Name: Show Labels for DIR ## Application: /home/user/customtools/labellist.pl ## Arguments: $u $p $c %D ## Check-box: Add to Applicable Context Menus ## Check-box: Run tool in terminal window # $user = shift ARGV; #The current user. $server = shift ARGV; #ip_address:port of your Perforce server. $client = shift ARGV; #The current active client. $path = shift ARGV; #The current selected depot path. $p4 = "/home/shimada/p4bin/p4"; #Absolute path to the p4 cli program. $cmd = "$p4 -u $user -p $server labels $path |"; open RESULTS, $cmd or die "Cannot run labels command.\n\n"; $count = 0; print "...\n"; while () { chomp; print "$_\n"; $count++; } if($count eq 0) { print "\nNo results found.\n"; } exit 0;