Bill Shannon wrote:
> 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?
>
The environment variables for the command. For example, the deploy
command takes virtualservers as an option. If I have in the
environment: "AS_ADMIN_VIRTUALSERVERS=vs1,vs2" the virtualservers option
will automatically be placed as an option in the deploy command.
For other commands like create-domain, create-jdbc-resource etc that do
not have virtualservers as an option, will not be in the command
execution even though the environment variable is set in either
multimode or singlemode.
So in v2, the option --virtualservers is printed for deploy command if
--echo=true even though user did not explicitly enter --virtualservers.
And for other command that do not have "virtualservers" as an option
will not be printed if --echo=true.
>
>> 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.
>
That's good to know... then we don't need new commands: "getoptions" and
"setoptions". My understanding is that this new command is for the
generic options to asadmin.
If --echo=true prints out environment variables and default values for
the executing command then isn't that sufficient to the user?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>
>