On Wed, Nov 28, 2018 at 12:07:37AM +0100, Klemens Nanni wrote:
> On Tue, Nov 27, 2018 at 03:52:52PM -0600, Scott Cheloha wrote:
> > > > static int
> > > > +getorder(char *field)
> > > > +{
> > > > + rev_order = field[0] == '-';
> > > > +
> > > > + return string_index(rev_order ? field
On Wed, Nov 28, 2018 at 12:07:37AM +0100, Klemens Nanni wrote:
> Note how an empty field is silently treated as the default field
> "state", but that's an independent issue I'd like to address in a
> separate diff for string_index().
Not a problem of string_index() actually.
We consistently
On Tue, Nov 27, 2018 at 03:52:52PM -0600, Scott Cheloha wrote:
> > > static int
> > > +getorder(char *field)
> > > +{
> > > + rev_order = field[0] == '-';
> > > +
> > > + return string_index(rev_order ? field + 1 : field, statics.order_names);
> > > +}
> > > +
>
> You need to check that the
On Tue, Nov 27, 2018 at 11:28:31AM -0600, Scott Cheloha wrote:
> No objections here to the feature in general. We already support reversing
> select orderings in systat(1), which I've found useful in practice, so this
> is not without precedent and is consistent with at least one other monitoring
On Tue, Nov 27, 2018 at 11:28:31AM -0600, Scott Cheloha wrote:
> On Sat, Nov 24, 2018 at 04:06:34PM +0100, Klemens Nanni wrote:
> > Sometimes I want to see certain programs with least amount of memory,
> > so this diff implements `o -field' to sort in reverse order.
> >
> > The logic is straight
On Tue, Nov 27, 2018 at 07:38:59PM +, Jason McIntyre wrote:
> On Tue, Nov 27, 2018 at 11:28:31AM -0600, Scott Cheloha wrote:
> > > @@ -137,13 +137,16 @@ mode.
> > > This is identical to
> > > .Em batch
> > > mode.
> > > -.It Fl o Ar field
> > > +.It Fl o Oo - Oc Ns Ar field
> > > Sort the
On Tue, Nov 27, 2018 at 11:28:31AM -0600, Scott Cheloha wrote:
> > @@ -137,13 +137,16 @@ mode.
> > This is identical to
> > .Em batch
> > mode.
> > -.It Fl o Ar field
> > +.It Fl o Oo - Oc Ns Ar field
> > Sort the process display area using the specified
> > .Ar field
> > as the primary key.
On Sat, Nov 24, 2018 at 04:06:34PM +0100, Klemens Nanni wrote:
> Sometimes I want to see certain programs with least amount of memory,
> so this diff implements `o -field' to sort in reverse order.
>
> The logic is straight forward:
>
> 1. merge common code from argument and command loops into
Sometimes I want to see certain programs with least amount of memory,
so this diff implements `o -field' to sort in reverse order.
The logic is straight forward:
1. merge common code from argument and command loops into new setorder()
2. introduce global state `rev_order' (set in the helper)
3.