Class PerforceInfoCommand

java.lang.Object
org.apache.maven.scm.command.AbstractCommand
org.apache.maven.scm.provider.perforce.command.PerforceInfoCommand
All Implemented Interfaces:
Command, PerforceCommand

public class PerforceInfoCommand extends AbstractCommand implements PerforceCommand
Encapsulates the 'p4 info' command which can be very useful in determining the runtime environment. Use getEntry(String key) to query the info set for a particular property. The data from p4 info looks like this:

 User name: mperham
 Client name: mikeperham-dt
 Client host: mikeperham-dt
 Client root: d:\perforce
 

where the key is the content before the first colon and the value is the data after the first colon, trimmed. For example: PerforceInfoCommand.getInfo( this, repo ).getEntry( "User name" )

Note that this is not a traditional SCM command. This uses the Command class simply because it needs a logger for error handling and the current repository data for command line creation.