#!/bin/sh #Function to print help to the user: usage() { cat 1>&2 << EOF Usage: $0 [--useJava ] input.xml This script will apply an XSLT transformation to Beast 2 input files, setting them up for multithreaded execution. (Which is not the default.) It is really only meant for CIPRES, but my be useful to others. OPTIONS: --useJava This sets whether ThreadedTreeLikelihood objects should use java or not(beagle). Apparently version 2.1.3 of BEAST 2 defaults this to "true" regardless of what is set at the command-line. Highly inconvenient. This script defaults to using false for this. EOF } #bash command line parameter USEJAVA=false #Parse the command line PARSINGARGS=1 while [[ "$PARSINGARGS" == "1" && "$1" ]] do case $1 in -h|--help) usage; exit 0;; --useJava|--usejava) shift; USEJAVA=$1; shift;; *) PARSINGARGS=0;; esac done if [[ "$USEJAVA" != "true" && "$USEJAVA" != "false" ]] then echo Invalid choice for --useJava option: $USEJAVA 1>&2 exit 1 fi #Begin XSLT transformation xsltproc -stringparam usejavain ${USEJAVA} - ${1} << EOF true Please do not use ParticleFilter on CIPRES. Contact CIPRES administrators if this is absolutely necessary for your science. EOF #END XSLT exit $?