From ebadd3ccc6af24977a3b9fa409f6cafd5d90bc0d Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 20 Nov 2024 12:35:17 +0100 Subject: [PATCH] man: refactor check for variant Remove unnecessary checks and move the comment to the 1st. check. --- tools/man-generator.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tools/man-generator.c b/tools/man-generator.c index e0903c2e2..14bdfb86a 100644 --- a/tools/man-generator.c +++ b/tools/man-generator.c @@ -791,6 +791,7 @@ static void _print_man_usage_common_cmd(struct command *cmd) int i, sep, oo, opt_enum; int found_common_command = 0; + /* common cmd options only used with variants */ if (cna->variants < 2) return; @@ -824,10 +825,6 @@ static void _print_man_usage_common_cmd(struct command *cmd) if (!opt_names[opt_enum].short_opt) continue; - /* common cmd options only used with variants */ - if (cna->variants < 2) - continue; - if (_is_lvm_all_opt(opt_enum)) continue; @@ -861,10 +858,6 @@ static void _print_man_usage_common_cmd(struct command *cmd) if (opt_names[opt_enum].short_opt) continue; - /* common cmd options only used with variants */ - if (cna->variants < 2) - continue; - if (_is_lvm_all_opt(opt_enum)) continue;