[Libguestfs] [nbdkit PATCH] main: More idiomatic use of getopt_long

Richard W.M. Jones rjones at redhat.com
Fri Jun 29 12:18:37 UTC 2018


On Thu, Jun 28, 2018 at 11:36:16AM -0500, Eric Blake wrote:
> Prefer named constants over magic numbers in the 'struct option'
> list, and expand the list of enums for long-only options so that
> the call to getopt_long() can switch directly to every option,
> rather than needing a lengthy if/else chain that grows for every
> new long option.
> 
> Patch best viewed with whitespace changes ignored.

Interesting, we could use this all over libguestfs too.  I didn't
know this was possible.

ACK.

Thanks,
Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the Libguestfs mailing list