genl-ctrl-list: Introduce -d|--details as a shortcut for --format=details
This commit is contained in:
parent
f54ac3d55f
commit
073ef6a66e
1 changed files with 5 additions and 3 deletions
|
@ -20,10 +20,10 @@ static struct nl_cache *alloc_genl_family_cache(struct nl_sock *sk)
|
|||
static void print_usage(void)
|
||||
{
|
||||
printf(
|
||||
"Usage: genl-ctrl-list [OPTION]...\n"
|
||||
"Usage: genl-ctrl-list [--details]\n"
|
||||
"\n"
|
||||
"Options\n"
|
||||
" -f, --format=TYPE Output format { brief | details | stats }\n"
|
||||
" -d, --details Include detailed information in the list\n"
|
||||
" -h, --help Show this help\n"
|
||||
" -v, --version Show versioning information\n"
|
||||
);
|
||||
|
@ -46,18 +46,20 @@ int main(int argc, char *argv[])
|
|||
for (;;) {
|
||||
int c, optidx = 0;
|
||||
static struct option long_opts[] = {
|
||||
{ "details", 0, 0, 'd' },
|
||||
{ "format", 1, 0, 'f' },
|
||||
{ "help", 0, 0, 'h' },
|
||||
{ "version", 0, 0, 'v' },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "f:hv", long_opts, &optidx);
|
||||
c = getopt_long(argc, argv, "df:hv", long_opts, &optidx);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 'f': params.dp_type = nl_cli_parse_dumptype(optarg); break;
|
||||
case 'd': params.dp_type = NL_DUMP_DETAILS; break;
|
||||
case 'h': print_usage(); break;
|
||||
case 'v': nl_cli_print_version(); break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue