The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SVK::Command - Base class for SVK commands

SYNOPSIS

  use SVK::Command;
  # invoking commands
  SVK::Command->invoke ($xd, $cmd, $output, @arg);

DESCRIPTION

Invoking commands

Use SVK::Command->invoke. The arguments in order are the SVK::XD object, the command name, the output scalar ref, and the arguments for the command. The command name is translated with the %alias map.

Implementing svk commands

SVK::Command->invoke loads the corresponding class SVK::Command::$name, so that's the class you want to implement the following methods in:

options

Returns a hash where the keys are Getopt::Long specs and the values are a string that will be the keys storing the parsed option in $self.

parse_arg

Given the array of command arguments, use arg_* methods to return a more meaningful array of arguments.

lock

Use the lock_* methods to lock the SVK::XD object. The arguments will be what is returned from parse_arg.

run

Actually process the command. The arguments will be what is returned from parse_arg.

Returned undef on success. Return a string message to notify the caller errors.

METHODS

Methods for parse_arg

arg_depotname

Argument is a name of depot. such as '' or 'test' that is being used normally between two slashes.

arg_path

Argument is a plain path in the filesystem.

arg_copath

Argument is a checkout path.

arg_depotpath

Argument is a depotpath, including the slashes and depot name.

arg_co_maybe

Argument might be a checkout path or a depotpath.

arg_condensed

Argument is a number of checkout paths.

All the methods except arg_depotname returns a SVK::Target object, which is a hash with the following keys:

cinfo
copath
depotpath
path
repos
repospath
report
targets

The hashes are handy to pass to many other functions.

Methods for lock

lock_none
lock_target

Others

brief_usage

Display an one-line brief usage of the command. Optionally a file could be given to extract the usage from the pod.

usage

Display usage. An optional argument is to display detail or not.

TODO

SEE ALSO

SVK, SVK::XD, SVK::Command::*

AUTHORS

Chia-liang Kao <clkao@clkao.org>

COPYRIGHT

Copyright 2003-2004 by Chia-liang Kao <clkao@clkao.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html