Petals CLI SNAPSHOT

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (1)

View Page History
{code}

h2. Working with variables

Petals CLI supports variables as properties or environment variables. A variable is a placeholder with a name: {{ \${_variable-name_\}}}, that is replaced by its value when evaluating the command in which it is used. By default, a variable is a property. An environment variable is identified by a name prefixed with "env:":
{code}
connect -h ${host.name} -n ${host.port} -u ${env:USER} -p ${host.password}
{code}

h3. Listing available variables

The command '_set_' without argument lists all available variables: properties and environment variables:
{code}
> ./petals-cli.sh -C

Type 'help' for help.
------------------------------------------------------------------------------
petals-cli> set
...
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.6.0_45-b06
java.specification.name=Java Platform API Specification
java.specification.vendor=Sun Microsystems Inc.
java.specification.version=1.6
...
env:PATH=usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/cdeneux/jdk1.6.0_45/bin:/home/cdeneux/maven/bin
env:PETALS_CLI_PREFS=/home/cdeneux/.petals-cli/petals-cli.default
env:PLAY2_HOME=/home/cdeneux/play-2.1.1
...
{code}

h3. Setting a variable as property

A property can be set using the command '_set_':
{code}
set [ property-name = property-value ]
set [ property-name =: property-value ]
set [ property-name : property-value ]
{code}

h2. Return codes of Petals CLI