diff --git a/src/bee-init.sh.in b/src/bee-init.sh.in index 835ba6f..c7b7051 100644 --- a/src/bee-init.sh.in +++ b/src/bee-init.sh.in @@ -41,7 +41,6 @@ function usage() { Max Planck Institute for Molecular Genetics Berlin Dahlem bee [bee-options] init [options] - bee [bee-options] init [options] [url] Options: --configure=MODE set configure mode: @@ -57,6 +56,7 @@ function usage() { -V --version print version number. -D --define=A=B define ENV variables with the bee-file. (extra (over)quoting may be needed if B contains spaces.) + -o --output=bee-file name of new bee-file Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -151,23 +151,15 @@ function create_beefile_from_template { } function initialize() { - # get arguments starting with '--' - while [ -n "${1}" ] ; do - if [ "${1:0:2}" == "--" ] ; then - DEFAULT_CONFIGURE_OPTIONS="${DEFAULT_CONFIGURE_OPTIONS:+${DEFAULT_CONFIGURE_OPTIONS} }${1}" - else - PP="${PP:+${PP} }${1}" - fi - shift - done + surl=${1} + + shift + + pname=${OPT_OUTPUT} - # set positional parameters to arguments not starting with '--' - set -- ${PP} - pname=$1 - surl=$2 + DEFAULT_CONFIGURE_OPTIONS="${@}" - if [ -z "${surl}" ] ; then - surl=${pname} + if [ -z "${pname}" ] ; then # fix sourceforge urls for automatic pkgname generation if [[ $surl = *://sourceforge.net/*/files/*/download ]] ; then @@ -182,8 +174,6 @@ function initialize() { # strip /download basename surl=${surl%/download} - - pname=${surl} fi # start auto packagename generation with surl basename @@ -277,6 +267,7 @@ options=$(${BEE_BINDIR}/beegetopt --name bee-init \ --option disable-versionify \ --option help/h \ --option version/V \ + --option output/o= \ --option define/D= \ --option template/t= \ --option force/f \ @@ -306,6 +297,7 @@ if [ $? != 0 ] ; then fi OPT_VERSIONIFY="yes" +OPT_OUTPUT= eval set -- "${options}" @@ -369,6 +361,11 @@ while true ; do shift 2 ;; + --output) + OPT_OUTPUT=${2} + shift 2 + ;; + --define) OPT_DEFINE="${OPT_DEFINE}\n${2}" shift 2