Friday Dec 01, 2006
Friday Dec 01, 2006
Have you ever stumbled upon what commands to use in asadmin?
Have you ever mistyped a command and the following message is displayed?
Use "help" command for a list of valid commands.
CLI001 Invalid Command, list-component.
And when you execute "asadmin help", the manpage scrolls down the screen with 200 commands.
Finding the right command is not easy, especially searching through the 200 commands listed in the manpage.
For those who fall in the above scenario, I have good news to bring to you.
Starting in GlassFish V2 build 26, asadmin will search for the closest matched commands if the command cannot be found.
Let me give you some examples.
Say that you mistyped "create-domain":
asadmin create-domian options...
returns:
CLI001 Invalid Command, create-domian.
Closest matched command(s):
create-domain
Use "help" command for a list of valid commands.
asadmin is able to figure out the command that you're trying to execute is "create-domain", not "create-domian".
Now, say that you want find the commands associated "jdbc".
On the command prompt, type:
asadmin jdbc
returns all the commands with "jdbc":
CLI001 Invalid Command, jdbc.
Closest matched command(s):
create-jdbc-connection-pool
create-jdbc-resource
delete-jdbc-connection-pool
delete-jdbc-resource
list-jdbc-connection-pools
list-jdbc-resources
Use "help" command for a list of valid commands.
You can even use regular expression to search for the commands.
asadmin "resource$"
returns all the commands that ends with "resource":
CLI001 Invalid Command, resource$.
Closest matched command(s):
create-connector-resource
create-custom-resource
create-javamail-resource
create-jdbc-resource
create-jms-resource
create-jndi-resource
create-persistence-resource
delete-connector-resource
delete-custom-resource
delete-javamail-resource
delete-jdbc-resource
delete-jms-resource
delete-jndi-resource
delete-persistence-resource
Use "help" command for a list of valid commands.
You can narrow down the search by adding more regular expressions:
asadmin "^create.*resource$"
returns all the commands that begins with "create"and ends with "resource":
CLI001 Invalid Command, ^create.*resource$.
Closest matched command(s):
create-connector-resource
create-custom-resource
create-javamail-resource
create-jdbc-resource
create-jms-resource
create-jndi-resource
create-persistence-resource
Use "help" command for a list of valid commands.
This feature also applies to the "help" command. When a manpage cannot be found for a command, a list of closest matched commands is displayed.
If you find this feature interesting and want to give it a try, download the latest GlassFish V2.
Posted by Kedar Mhaswade on December 01, 2006 at 01:56 PM PST #
Posted by Jennifer Chou on December 01, 2006 at 04:28 PM PST #
Posted by Hrishikesh Barua on December 01, 2006 at 11:43 PM PST #
Posted by 160.57.144.31 on December 04, 2006 at 02:47 AM PST #