Enhance s-ramp CLI property interpolation: support default values
------------------------------------------------------------------
Key: SRAMP-452
URL:
https://issues.jboss.org/browse/SRAMP-452
Project: S-RAMP
Issue Type: Enhancement
Security Level: Public(Everyone can see)
Components: Shell
Reporter: Eric Wittmann
Assignee: Eric Wittmann
Fix For: 0.5.0.Final
Currently the shell supports property interpolation so that variables can be used in CLI
command files. This takes the following form (for example):
{code}
connect
http://localhost:8080/s-ramp ${username} ${password}
{code}
The CLI can then be invoked like this:
{code}
sramp.sh -f path/to/cli.txt -Dusername=admin -Dpassword=adminp
{code}
This is good, but let's also support optional default values for the variables, like
this:
{code}
connect
http://localhost:8080/s-ramp ${username:admin} ${password:adminp}
{code}
This will continue to replace ${username} with whatever value is passed via
-Dusername=blah. However, if -Dusername is *not* provided, then the default value of
'admin' will be used. This will result in more powerful CLI scripts with commands
like this:
{code}
connect ${sramp.endpoint:http://localhost:8080/s-ramp} ${sramp.username:admin}
${sramp.password:adminp}
{code}