|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-tools
Re: [Xen-tools] [PATCH] Add a --format parameter to xm list
 
On Wed, 2005-08-10 at 17:21 -0500, Anthony Liguori wrote:
> The following patch adds a --format option to xm list which let's you 
> specify a python formatting string to use.  Since we're using named 
> keys, it ends up working very nicely.  The above can be done with:
> 
> res=`xm list -f "%(mem)d" $VM`
> 
> Which is considerably nicer and more robust against slight changes in 
> the display format.
I know several tools go this way, but actually prefer one or more "-f
<fieldname>" args, and an "-s <seperator>" (or -0 for a nul) arg.  That
makes getting a single field very easy, without doing formatting in xend
which people might start to rely on.
This is analogous to the "old modinfo" vs "new modinfo" where I decided
to do it this way.
Cheers,
Rusty.
-- 
A bad analogy is like a leaky screwdriver -- Richard Braakman
_______________________________________________
Xen-tools mailing list
Xen-tools@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-tools
 
 |   
 
 | 
    | 
  
  
    |   | 
    |