#!/bin/sh

#
# @(#)extract_args.sh	1.5 01/12/12
#
# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#

#
# Copyright (c) 1997-8 by Sun Microsystems, Inc.
# All rights reserved.
#
# This script extract -J-xxx args which are args to the runtime from
# the actual arguments to the tool. 
#
# It places the results in the variables RUNTIME_ARGS and
# APP_ARGS. Target scripts should *source* this extraction script.
#

RUNTIME_ARGS=""
APP_ARGS=""
for a in "$@"
do
    if ja=`expr "$a" : '-J\(..*\)'`
    then 
	  RUNTIME_ARGS="$RUNTIME_ARGS $ja"
    else 
	APP_ARGS="$APP_ARGS '$a'"
    fi
done
