public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Shakur Shams Mullick <shakursmullick@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 6/8] misc-utils/lsblk.c: add sorting support for lsblk command
Date: Tue, 6 May 2014 12:43:19 +0200	[thread overview]
Message-ID: <20140506104319.GM5962@x2.net.home> (raw)
In-Reply-To: <1399138888-7554-6-git-send-email-shakursmullick@gmail.com>

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@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2014-05-06 10:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-03 17:41 [PATCH 1/8] libsmartcols/src/libsmartcols.h.in: add function name Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 2/8] libsmartcols/src/libsmartcols.sym: add function symbol Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 3/8] libsmartcols/src/smartcolsP.h: add sort flag and related enum Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 4/8] libsmartcols/src/table.c: implementation of 4 newly added functions Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 5/8] libsmartcols/src/table_print.c: sort table before printing Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 6/8] misc-utils/lsblk.c: add sorting support for lsblk command Shakur Shams Mullick
2014-05-06 10:43   ` Karel Zak [this message]
2014-05-03 17:41 ` [PATCH 7/8] misc-utils/lslocks.c: add sorting support for lslocks command Shakur Shams Mullick
2014-05-03 17:41 ` [PATCH 8/8] disk-utils/partx.c: add sorting support for partx command Shakur Shams Mullick
2014-05-06 10:33 ` [PATCH 1/8] libsmartcols/src/libsmartcols.h.in: add function name Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140506104319.GM5962@x2.net.home \
    --to=kzak@redhat.com \
    --cc=shakursmullick@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox