#!/usr/bin/env perl

# Fake binary to do as little as possible to pass tests.
if($ARGV[0] eq '--help') {
    print <<"EOHELP";
This is the help screen for the faux activemq binary.

The word stop in this text makes it look like the newer versions of ActiveMQ,
and that you need to use the console argument to get it to run.

All it supports is --help, which prints this message, and console, which will
wait forever.  --version will lie about what version of ActiveMQ this is.

It is as small as shim as useful.
EOHELP
    exit 1;
}

if($ARGV[0] eq 'console') {
    print <<"EOCONSOLE";
This script isn't going to do anything useful.  It's going to wait for nothing
to happen.

Press Control-C or otherwise signal it to end to get out.
EOCONSOLE
    while(1) {
        sleep 3600;
    }
    exit 1; # Not reached.
}

if($ARGV[0] eq '--version') {
    print <<"EOVERSION";
This is a fake version of

ActiveMQ 5.9.9

Don't get too excited about it.
EOVERSION
    exit 0;
}

print <<"EOERROR";
No useful command line was found.  Use --help to list the options, or console
to do nothing until you tell the program to stop. --version will lie about
what version this is.
EOERROR

exit 1;


