btrfs-progs: help: define helper for command with flags

Add macro to define a simple command that also gets some non-default
flags, eg. the output formats.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2019-06-20 20:49:46 +02:00
parent 17aee13fcd
commit 54fbdafdc5

View File

@ -88,6 +88,14 @@ struct cmd_struct {
DEFINE_COMMAND(name, token, cmd_ ##name, \
cmd_ ##name ##_usage, NULL, 0)
/*
* Define a command with flags, eg. with the additional output formats.
* See CMD_* .
*/
#define DEFINE_COMMAND_WITH_FLAGS(name, token, flags) \
DEFINE_COMMAND(name, token, cmd_ ##name, \
cmd_ ##name ##_usage, NULL, (flags))
/*
* Define a command group callback.
* It's assumed that the callback is called cmd_<name> and the