Re: [PATCH 1/6] Cleanup command line options in gendispatch.pl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 23, 2013 at 10:59:53AM -0600, Eric Blake wrote:
> On 04/23/2013 04:26 AM, Daniel P. Berrange wrote:
> > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> > 
> > There are many declared options in gendispatch.pl that were
> > no longer used. Those which were used were obsecure '-b', '-k'
> 
> s/obsecure/obscure/
> 
> > and '-d'. Switch to use --mode={debug|client|server}.
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> > ---
> >  daemon/Makefile.am     | 12 +++----
> >  src/Makefile.am        | 24 ++++++-------
> >  src/rpc/gendispatch.pl | 94 ++++++++++++++++++++++++--------------------------
> >  3 files changed, 63 insertions(+), 67 deletions(-)
> 
> > +++ b/src/rpc/gendispatch.pl
> 
> > +        # for now, we distinguish only two levels of prioroty:
> 
> s/prioroty/priority/ while reindenting.
> 
> Beyond that, I found it much easier to read with 'git diff -b':
> 
> > diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
> > index 65a0ac2..fdc345f 100755
> > --- a/src/rpc/gendispatch.pl
> > +++ b/src/rpc/gendispatch.pl
> > @@ -17,13 +17,15 @@
> > 
> >  use strict;
> > 
> > -use Getopt::Std;
> > +use Getopt::Long;
> > 
> > -# Command line options.
> > -# -k - client bodies
> > -# -b - server bodies
> > -our ($opt_p, $opt_t, $opt_a, $opt_r, $opt_d, $opt_b, $opt_k);
> > -getopts ('ptardbk');
> > +my $mode = "debug";
> > +my $res = GetOptions("mode=s" => \$mode);
> > +
> > +die "cannot parse command line options" unless $res;
> > +
> > +die "unknown mode '$mode', expecting 'client', 'server' or 'debug'"
> > +    unless $mode =~ /^(client|server|debug)$/;
> > 
> >  my $structprefix = shift or die "missing struct prefix argument";
> >  my $procprefix = shift or die "missing procedure prefix argument";
> > @@ -105,7 +107,7 @@ while (<PROTOCOL>) {
> >              push(@{$calls{$name}->{ret_members}}, $1);
> >          }
> >      } elsif ($collect_opts) {
> > -        if (m,^\s*\*\s*\@(\w+)\s*:\s*(\w+)\s*$,) {
> > +        if (m,^\s*\*\s*\@(\w+)\s*:\s*((?:\w|:)+)\s*$,) {
> 
> Does this change really belong here, or is it a separate cleanup better
> put in its own patch?

It should be in a later patch of mine which adds support for
ACL annotations.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]