#!/bin/bash

set -e

COMPILER_ID="6EEF08F979766A8BD00D4E9FE5AEA52549D2200F"

function usage()
{
    echo "Rakudo/Perl 6 Helper script"
    echo "Usage:"
    echo "  --compiler-id -c    print the rakudo compiler id"
    echo "  --help -h           show this text"
}

if [ $# -eq 0 ]; then
    echo "ERROR: no parameter specified"
    usage
    exit 1
fi

while [ "$1" != "" ]; do
    PARAM=`echo $1 | awk -F= '{print $1}'`
    VALUE=`echo $1 | awk -F= '{print $2}'`
    case $PARAM in
        -h | --help)
            usage
            exit
            ;;
        -c | --compiler-id)
            echo $COMPILER_ID
            exit
            ;;
        *)
            echo "ERROR: unknown parameter \"$PARAM\""
            usage
            exit 1
            ;;
    esac
    shift
done
            
