#=============================================================================
# Doloforge::Command::Test : test object for the doloforge command-line tool
#
# This object tests the link bertween the command-line tools and module
# implementations. This is also a module template for new commands.
#
# Full help :
#   doloforge test --man
#=============================================================================


package Doloforge::Command::Test;

use strict;

# This base class implements the constructor and help methods in a generic way.
use base qw(Doloforge::Command);


#=============================================================================
=encoding utf8

=head1 NAME

Doloforge::Command::Test - Test object for the doloforge command-line tool

=head1 SYNOPSIS

    # Check the configuration
    doloforge test --check

=head1 DESCRIPTION

Todo

=cut


#=============================================================================
# Method getOptions
#
# Accepted arguments from the command-line, in the form accepted by Getopt::Long.
# Options with no value that match method names of that package will be called as
# methods, with the decoded options as parameters.

sub getOptions {
    return (
        'check',                # function name (no value, the class defines a method of that name)
        'run',                  # function name (no value, the class defines a method of that name)
        'client|c=s',           # define the 'client' parameter of the function call
        'project|p=s',          # define the 'project' parameter of the function call
        'user|u=s',             # define the 'user' parameter of the function call
    );
}

#=============================================================================
# Method check
#
# Run a test check : show all configuration, arguments, options et al.

sub check {
    my $self = shift;

    my ($option) = @_;
    $self->message(Data::Dumper->Dump([$option, $self->{global}, $self->{config}], [qw(option global config)]));
}

#=============================================================================
# Method run
#
# Runs... something...

sub run {
    my $self = shift;

    my ($option) = @_;
    $self->message("run with client='$option->{client}' project='$option->{project}' user='$option->{user}'.");
}



1;
__END__

=head1 AUTHOR

Nicolas Huillard <F<nicolas@huillard.net>>, Dolomède

=head1 SEE ALSO

doloforge(1)

=cut
