Dennis' Weblog

Tuesday Apr 03, 2007

Auto Complete sub command names for amadm CLI for bash user

SuperPat, my dearest pal (cough, cough!) pointed me to this blog DSEE 6.0 CLI made easier for /bin/bash users

And hinted me that we need to have this for OpenSSO. And why not. But this can be done in a different manner.

Download the opensso.war from here, deploy and configure it.

Download the amAdminTools.zip from here, unzip it in a temporary directory and run the ./setup script.

type <deployuri>/bin/amadm to check that CLI is up and running. Next

<deployuri>/bin/amadm | perl -e 'my $x; while (<>)
  { chomp; if (($_ =~ /^   ( [a-z][\S]+)/) && ($_ !~ /amadm/))
  {$x .= $1; }} print $x;'
to get the list of sub commands. Then
complete -W "<paste the output of previous command>" amadm
Then you can do <deployuri>/bin/amadm add-<TAB><TAB> thingy.

Comments:

You got a tickly throat there, Dennis? :-P

Posted by Pat Patterson on April 04, 2007 at 02:05 PM PDT #

Feeling better now. Dearest Pal. :-)

Posted by Dennis Seah on April 04, 2007 at 11:28 PM PDT #

Post a Comment:
Comments are closed for this entry.

Calendar

Feeds

Search

Links

Navigation

Referrers