admin@glassfish.java.net

Re: --echo

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

Sankar Neelakandan wrote on 8/11/09 9:29 AM:
> Hi Bill,
>
> When a asadmin command was constructed from client side(previous
> releases) and sent to server for execution it was useful to know the
> options asadmin passed to the server besides user supplied options.
> Now server has all the command implementations and decides what to use
> in a command before executing it.

I'm not that familiar with how v2 worked. Are you saying that it
would print out the values of *all* options, even command options
that weren't explicitly specified? I was under the impression that
it only did this for the options that we're now calling the "asadmin
program (or utility) options".

> So if we can print what exactly being executed in the server as opposed
> to what is being passed to server , that would be beneficial for
> debugging and scripting purposes.

I don't believe there's any way to get this information back from the
server. asadmin can printout what it *sends* to the server, but it
doesn't have any way to know what defaults the server might be applying
for options that aren't explicitly set.

> /So, my question is, how important is it that --echo include values for asadmin options that have not been specified? Would it be sufficient if asadmin simply echoed the commands *as entered*?/
>
> No, It is important to know what is being executed, than as entered in
> the command

So you're not using this in the way people use "sh -x"?

Do you want this extra information in order to debug problems?
Or are you just looking for addition assurance that it's executing
the command you expect with the options you expect?

I'm fine with adding more debugging options, but I always thought
of --echo as synonymous with "sh -x", where echoing the commands
as entered would be sufficient to (e.g.) track what a script was
doing.

> $ asadmin --echo version
> asadmin program options: --host localhost --port 4848 --terse false
> --interactive true --secure false --echo false
> command: version --verbose false
>
>
> Also we don't need to print the command in two lines with words like all
> *program options:* and *command:* when the --echo=true simply print all
> the command options and subcommand and its options like below.
>
> $ asadmin --echo version
> asadmin --host=localhost --port=4848 --terse=false --interactive=true --secure=false --echo=true version --verbose false
>
> If it is multimode simply print the subcommand and its options excluding
> the asadmin options, like below.
>
> $ asadmin > --echo version
> version --verbose false

So when running a multimode script with (e.g.)
asadmin --echo multimode -f myscript
you don't need to see the details of the program options for each command
executed?