admin@glassfish.java.net

Re: Determining GlassFish version

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Thu, 24 Jun 2010 16:16:17 -0700

Paul M Davies (Oracle) wrote on 06/24/2010 09:13 AM:
> Hi,
>
> I'm not sure that --terse will give you exactly what you want. The
> --terse option eliminates messages that asadmin outputs about the
> progress of the subcommand. It doesn't affect the information that the
> subcomand retrieves:
>
> asadmin version
> Version = Oracle GlassFish Server 3.0.1 (build 22)
> Command version executed successfully.
>
> asadmin --terse version
> Version = Oracle GlassFish Server 3.0.1 (build 22)

Since "version" is an asadmin local command, we *could* change the
implementation to print the information differently if --terse is
specified.

"version" is also a remote command, which the local command uses
to get the version from the server if it's running. The remote
command doesn't know about --terse, and it currently returns the
full string for the version - "Oracle GlassFish Server 3.0.1 (build 22)".

So, --terse could easily get rid of the "Version = ", but if you want
to get rid of the product name you're going to need an option that's
passed to the remote command so that it can return different information.
(I don't think you want the new terse/short format output to only work
in the local case.)

You could have the local command specify a different option when it
calls the remote command, if --terse was specified. But I think it's
probably going to be better to use a new option for this.