WIP dynamic field list command.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Stefan Härter 2023-09-26 19:19:22 +02:00
parent fce4916235
commit 705a352f36

View File

@ -25,27 +25,60 @@ use warnings;
# OTOBO modules # OTOBO modules
our @ObjectDependencies = ( use parent qw(Kernel::System::Console::BaseCommand);
our @ObjectDependencies = (
'Kernel::System::DynamicField',
'Kernel::System::YAML',
'Kernel::System::JSON',
); );
=head1 NAME sub Configure {
my ( $Self, %Param ) = @_;
[name_placeholder] $Self->Description('List existing dynamic fields.');
$Self->AddOption(
=head1 DESCRIPTION Name => 'field-type',
Description => 'Filter by comma-separated field type(s).',
[description_placeholder] Required => 0,
HasValue => 1,
=head1 PUBLIC INTERFACE ValueRegex => qr/[A-Za-z0-9,]+/smx,
);
=head2 new() $Self->AddOption(
Name => 'object-type',
create an object. Do not use it directly, instead use: Description => 'Filter by comma-separated object type(s).',
Required => 0,
my $ListObject = $Kernel::OM->Get('Kernel::System::Console::Command::Admin::DynamicField::List'); HasValue => 1,
ValueRegex => qr/[A-Za-z0-9,]+/smx,
=cut );
$Self->AddOption(
Name => 'name-search',
Description => 'Filter by name or part of a name.',
Required => 0,
HasValue => 1,
ValueRegex => qr/[A-Za-z0-9-]+/smx,
);
$Self->AddOption(
Name => 'active',
Description => 'Filter by active state (0 or 1), default is both.',
Required => 0,
HasValue => 1,
ValueRegex => qr/^[0-1]{1}$/smx,
);
$Self->AddOption(
Name => 'verbose',
Description => 'If set, result includes complete config, otherwise only names and orders are given.',
Required => 0,
HasValue => 0,
);
$Self->AddOption(
Name => 'return-structure',
Description => 'Supported return structures are JSON and YAML, default is YAML.',
Required => 0,
HasValue => 1,
ValueRegex => qr/^(JSON)|(YAML)$/smx,
);
}
sub new { sub new {
my ( $Type, %Param ) = @_; my ( $Type, %Param ) = @_;