Re: lsblk "include" option?

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

 



On Tue, Jun 19, 2012 at 04:46:52PM +0200, Bernhard Voelker wrote:
> 
> 
> On 06/19/2012 04:26 PM, Karel Zak wrote:
> > On Fri, Jun 15, 2012 at 10:09:16AM -0300, Marcos Felipe Rasia de Mello wrote:
> >> lsblk has an "exclude" (-e, --exclude) option. I wonder if would be
> >> possible to add an "include" option to tell it to show *only*
> >> specified major number devices. Like
> >>
> >> lsblk -i 8
> > 
> >  Implemented (--include, -I)
> 
> 
> > diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
> > index f635a4a..0bcdbfc 100644
> > --- a/misc-utils/lsblk.c
> > +++ b/misc-utils/lsblk.c
> > @@ -142,7 +142,7 @@ static struct colinfo infos[] = {
> >  
> >  struct lsblk {
> >         struct tt *tt;                  /* output table */
> > -       unsigned int all_devices:1;     /* print all devices */
> > +       unsigned int all_devices:1;     /* print all devices, icluding empty */
> 
> s/icluding/including/
> 
> > @@ -1116,6 +1159,7 @@ static void __attribute__((__noreturn__)) help(FILE *out)
> >                 " -d, --nodeps         don't print slaves or holders\n"
> >                 " -D, --discard        print discard capabilities\n"
> >                 " -e, --exclude <list> exclude devices by major number (default: RAM disks)\n"
> > +               " -i, --include <list> show only devices with specified major numbers\n"
> 
> s/-i/-I/

Thanks for review!

> BTW: the <list> does not necessarily have to be comma separated;
> e.g. a dot also works: "lsblk -I 8.11". The same applies to "-e",
> of course.

Fixed, this is unexpected feature.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux