Re: [PATCH 6/8] misc-utils/lsblk.c: add sorting support for lsblk command

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

 



On Sat, May 03, 2014 at 11:41:26PM +0600, Shakur Shams Mullick wrote:
> It adds support for sorting in lsblk command. sorting can be done by name(-c) or size(-z). For longoptions use --sort name or --sort size
> 
> e.g. lsblk -c
>      lsblk -q name
>      lsblk --sort size

IMHO it would be better to have a generic option

    lsblk --order-by <column>

and maybe sort-cuts --order-by-size and --order-by-name to sort by NAME
and SIZE columns. (or s/order/sort/ ...)

It will probably necessary to add info about compare function type
(number or string) to lsblk "struct colinfo".

Maybe we can also add scols_cmpstr_cells() and scols_cmpnum_cells() to
the library to avoid duplicate code.

    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