admin@glassfish.java.net

Re: --echo

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Tue, 11 Aug 2009 15:20:21 -0700

Jane Young wrote on 8/11/09 10:20 AM:
> I think it's beneficial to print out the environment variables but only
> for the options that are used in the command.
> Kedar, what is reasoning behind leaving out the environment variables?
> In v2, the environment variables are printed with the --echo option.

*Which* environment variables?

*Any* option, program option or command option, can be set as an
environment variable.

How exactly (what format) did v2 print them out with --echo?

> Instead of adding a new commands, "getoptions" and "setoptions" for the
> default values in multimode, is it possible to use the "export" command
> and make the default values as the environment variables in multimode.
> e.g.
>
> $asadmin --host localhost --port 4848 --user admin --echo true multmode
> asadmin>export
> AS_ADMIN_HOST=localhost
> AS_ADMIN_PORT=4848
> AS_ADMIN_USER=admin
> AS_ADMIN_ECHO=true
> asadmin>version --verbose true
> ....
>
> To change the default value, use export command:
> asadmin>export AS_ADMIN_USER=foobar AS_ADMIN_PORT=8484
> asadmin>version --verbose true
>
> To change generic option w/o modifying the environment varialbe:
> asadmin>version --echo false --verbose
>
> Will this work?

Yes, that's how it currently works.

But note that it only includes the environment variables for the
program options that you specify explicitly. If your goal is to
find out the effective value of every program option, whether
specified explicitly on the command line, or implicitly via an
environment variable, or defaulted, this isn't going to give you
that.