Page MenuHomeFreeBSD

implement sorting for 'bectl list' output
ClosedPublic

Authored by rob.fx907_gmail.com on Jul 1 2019, 11:05 AM.

Details

Summary

Allow 'bectl list' to sort output by a given property name. The property name is passed in using a command-line
flag, '-c' for ascending order and '-C' for descending order. The properties allowed to sort by are:

name (the default output, even if '-c' or '-C' are not used)
creation
origin
used
usedds
usedsnap
usedrefreserv

The default output for 'bectl list' would now be in ascending alphabetical order.

To sort by creation time from earliest to latest, the command would be 'bectl list -c creation'

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ler accepted this revision.Jul 1 2019, 4:04 PM

The concept looks good, as to whether the C code is right, that's not in my bailiwick. Thank you for doing this.

This revision is now accepted and ready to land.Jul 1 2019, 4:04 PM
kevans added a comment.Sep 4 2019, 1:55 PM

I'm going to commit this today with just very minor massaging to the manpage and getopt parsing to reflect that -c/-C are mutually exclusive.

kevans added a comment.Sep 4 2019, 1:55 PM

I'm going to commit this today with just very minor massaging to the manpage and getopt parsing to reflect that -c/-C are mutually exclusive.

and apologies for the super long delay. =-(

This revision was automatically updated to reflect the committed changes.