command line completion in GlassFish
Wednesday Sep 06, 2006
"GlassFish ":https://glassfish.dev.java.net/ has powerful command line interface in the form of asadmin. I used the following technique to have the bash shell autocomplete the asadmin commands and options .
1. create the directory (if it doesnt exist already)
mkdir -p /etc/bash_completion.d/
2. create the file /etc/bash_completion.d/asadmin with the following contents
_asadmin()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=`cat /etc/bash_completion.d/commands.txt`
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _asadmin asadmin
3. download and copy the "file commands.txt ":http://blogs.sun.com/harsha/resource/commands.txt to /etc/bash_completion.d/
4. source the above script into your current bash shell
source /etc/bash_completion.d/asadmin
Now say you want to start the domain in debug mode, press
asadmin sta[TAB]do[TAB] --deb[TAB], you can see autocompletion in action.
I used "this helpful document ":http://www.debian-administration.org/articles/317 in trying out this. The file commands.txt was generated from the "file CLIDescriptor ":http://fisheye5.cenqua.com/browse/glassfish/admin-cli/commands/src/java/com/sun/enterprise/cli/commands/CLIDescriptor.xml?r=MAIN .



















This is cool!
It even displays a list of ava...
How can I get the callflow monitoring data into my...