#!/usr/pkg/bin/perl

=begin metadata

Name: echo
Description: echo arguments
Author: Randy Yarger, randy.yarger@nextel.com
License: perl

=end metadata

=cut

package PerlPowerTools::echo;

use strict;

our $VERSION = '1.3';

# run if called directly, indirectly, directly par-packed, undirectly par-packed
__PACKAGE__->run( @ARGV ) if !caller() || caller(0) =~ /^(PerlPowerTools::Packed|PAR)$/ || caller(1) eq 'PAR';

sub run {
    my ( $self, @args ) = @_;

    my $N = 1;
    if (@args && $args[0] eq '-n') {
        $N = 0;
        shift @args;
    }

    print join ' ', @args;
    print "\n" if $N == 1;

    exit 0;
}

1;

__END__

=pod

=head1 NAME

echo - echo arguments

=head1 SYNOPSIS

echo [-n] [arguments...]

=head1 DESCRIPTION

echo prints the command line arguments separated by spaces. A newline is
printed at the end unless the '-n' option is given.

=head2 OPTIONS

I<echo> accepts the following options:

=over 4

=item -n

Do not print a newline after the arguments.

=back

=head1 ENVIRONMENT

The working of I<echo> is not influenced by any environment variables.

=head1 BUGS

I<echo> has no known bugs.

=head1 AUTHOR

The Perl implementation of I<echo>
was written by Randy Yarger, I<randy.yarger@nextel.com>.

=head1 COPYRIGHT and LICENSE

This program is copyright by Randy Yarger 1999.

This program is free and open software. You may use, modify, distribute
and sell this program (and any modified variants) in any way you wish,
provided you do not restrict others to do the same.

=cut
