[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: who: sorted output + minor usage change
From: |
Pádraig Brady |
Subject: |
Re: who: sorted output + minor usage change |
Date: |
Sat, 07 Feb 2015 13:46:31 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 07/02/15 02:04, Assaf Gordon wrote:
> Hello,
>
> Two suggestions for 'who':
>
> first,
> the --help text for '-u/--users' option is not clear (IMHO).
>
> 'who --help' says:
> -u, --users list users logged in
>
> Whereas the Coreutils manual says:
> "-u => After the login time, print the number of hours and minutes that the
> user has been idle. [...]"
>
> And posix says (
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/who.html ):
> "-u => Write "idle time" for each displayed user in addition to any other
> information. [...]".
>
> so, except in the --help text, it talks about showing idle time.
> Perhaps consider slightly modifying the usage text? (that's the first patch
> attached).
>
>
> second,
> would you consider adding a 'sort' option to sort output by different fields?
> The attached patch implements this.
> examples:
> who -a --sort=idle
> who -a --sort=name
> who -a --sort=line
>
> Normally, piping to 'sort' should be enough, but the fields output by 'who'
> are not fixed, so sorting with whitespace delimiters is tricky,
> and sorting by exact character position is messy, and depends on the option
> used.
> Also, for sorting by idle time, the field conains mixed digits and characters
> (e.g. "." for recently active, and "old" for not active) - not easily sorted.
Initially I thought this was overkill.
Though the sorting is in place and so as scalable as it was previously.
Also sorting existing output is very difficult as you say.
So +1 from me.
thanks!
Pádraig