]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r351813, r352092: bectl(8) list sorting
authorKyle Evans <kevans@FreeBSD.org>
Sun, 15 Sep 2019 02:36:50 +0000 (02:36 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Sun, 15 Sep 2019 02:36:50 +0000 (02:36 +0000)
commitad8c522be216e0422ecdcf7d0f1a27198baa2dd3
treee43b0988888fd4f894361b958286ab4f57dfe535
parent7b3e00f6aca83f9615fc5ca618807f04be785e1d
MFC r351813, r352092: bectl(8) list sorting

MFC r351813: bectl(8): implement sorting for 'bectl list' output

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' is now ascending alphabetical order of
BE name.

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

MFC r352092: bectl(8): initialize reverse earlier

This turns into a warning in GCC 4.2 that 'reverse' may be used
uninitialized in this function. While I don't immediately see where it's
deciding this from (there's only two paths that make column != NULL, and
they both set reverse), initializing reverse earlier is good for clarity.
sbin/bectl/bectl.8
sbin/bectl/bectl.c
sbin/bectl/bectl_list.c