WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-tools

Re: [Xen-tools] [PATCH] Add a --format parameter to xm list

To: Anthony Liguori <aliguori@xxxxxxxxxx>
Subject: Re: [Xen-tools] [PATCH] Add a --format parameter to xm list
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Thu, 11 Aug 2005 12:39:30 +1000
Cc: Xen Tools <xen-tools@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 11 Aug 2005 02:37:35 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <42FA7DD3.9090606@xxxxxxxxxx>
List-help: <mailto:xen-tools-request@lists.xensource.com?subject=help>
List-id: Xen control tools developers <xen-tools.lists.xensource.com>
List-post: <mailto:xen-tools@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-tools>, <mailto:xen-tools-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-tools>, <mailto:xen-tools-request@lists.xensource.com?subject=unsubscribe>
References: <42FA7DD3.9090606@xxxxxxxxxx>
Sender: xen-tools-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>