---
name: "Message::Passing::Role::CLIComponent"
section: "3pm"
platform: "linux"
package: "libmessage-passing-perl"
version: "0.117-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Message::Passing::Role::CLIComponent"
---

# Message::Passing::Role::CLIComponent(3pm)

Package::Variant providing 'foo' and 'foo\_options' attributes

## NAME

Message::Passing::Role::CLIComponent - Package::Variant providing 'foo' and 'foo\_options' attributes

## SYNOPSIS

```
    package My::Message::Passing::Script;
    use Moo;
    use MooX::Options;
    use Message::Passing::Role::CLIComponent;
    use Message::Passing::DSL;
    use namespace::clean -except => 'meta';
    with
        CLIComponent( name => 'input', default => 'STDIN' ),
        'Message::Passing::Role::Script';
    sub build_chain {
        my $self = shift;
        message_chain {
            input example => ( %{ $self->input_options }, output_to => 'test_out', class => $self->input, );
            output test_out => ( ... );
        };
    }
    __PACKAGE__->start unless caller;
    1;
```

## DESCRIPTION

A Package::Variant role producer, which is used to provide a pair of attributes for name/options as per the message-pass script.

## ROLE PARAMETERS

### name

The name of the main attribute. An additional attribute called `"${name}_options"` will also be added, which coerces a hashref from JSON.

### default

A default value for the main attribute. If this is not supplied, than the attribute will be required.

## SPONSORSHIP

This module exists due to the wonderful people at Suretec Systems Ltd. \<http://www.suretecsystems.com/\> who sponsored its development for its VoIP division called SureVoIP \<http://www.surevoip.co.uk/\> for use with the SureVoIP API - \<http://www.surevoip.co.uk/support/wiki/api\_documentation\>

## AUTHOR, COPYRIGHT AND LICENSE

See Message::Passing.
