Skip to contentSkip to conversation

pvdisplay: support -a option

PATCH New Wu Guanghao 2 participants 3 messages Jun 9, 2022 – Jun 27, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pvdisplay: support -a option

pvdisplay already supports the -a option, but it is filtered at the begining, so delete the redundant judgment.

---
 tools/pvdisplay.c | 1 -
 1 file changed, 1 deletion(-)
tools/pvdisplay.c +0 -1
index 11f38ebd2..1ed9c0d3f 100644
@@ -72,7 +72,6 @@ int pvdisplay(struct cmd_context *cmd, int argc, char **argv)
        }
 
        if (arg_is_set(cmd, aligned_ARG) ||
-           arg_is_set(cmd, all_ARG) ||
            arg_is_set(cmd, binary_ARG) ||
            arg_is_set(cmd, noheadings_ARG) ||
            arg_is_set(cmd, options_ARG) ||

--
2.27.0

#1 lore raw

PATCH 1/1 pvdisplay: support -a option

ping...

? 2022/6/9 9:47, Wu Guanghao ??:

Quoted 23 lines

pvdisplay already supports the -a option, but it is filtered at the begining, so delete the redundant judgment.

---
 tools/pvdisplay.c | 1 -
 1 file changed, 1 deletion(-)
tools/pvdisplay.c +0 -2
index 11f38ebd2..1ed9c0d3f 100644
@@ -72,7 +72,6 @@ int pvdisplay(struct cmd_context *cmd, int argc, char **argv)
        }
 
        if (arg_is_set(cmd, aligned_ARG) ||
-           arg_is_set(cmd, all_ARG) ||
            arg_is_set(cmd, binary_ARG) ||
            arg_is_set(cmd, noheadings_ARG) ||
            arg_is_set(cmd, options_ARG) ||
--

2.27.0

#2 lore raw

PATCH 1/1 pvdisplay: support -a option

Quoted 15 lines · Wu Guanghao
Quoted 15 lines

pvdisplay already supports the -a option, but it is filtered at the begining, so delete the redundant judgment.

---
 tools/pvdisplay.c | 1 -
 1 file changed, 1 deletion(-)
tools/pvdisplay.c +0 -0
index 11f38ebd2..1ed9c0d3f 100644
@@ -72,7 +72,6 @@ int pvdisplay(struct cmd_context *cmd, int argc, char **argv)
        }
 
Quoted 5 lines

tools/pvdisplay.c int pvdisplay(struct cmd_context *cmd, int argc, char **argv) · line 77

Quoted 5 lines
tools/pvdisplay.c +0 -1
        if (arg_is_set(cmd, aligned_ARG) ||
-           arg_is_set(cmd, all_ARG) ||
            arg_is_set(cmd, binary_ARG) ||
            arg_is_set(cmd, noheadings_ARG) ||
            arg_is_set(cmd, options_ARG) ||

You've probably seen that tools/command-lines.in is where we now define the options accepted by each command. But, many commands still contain redundant option checking that could be removed. So, nearly all of the option checks in pvdisplay can be removed, not just -a (and many of the option combination rules can also be defined in command-lines.h.) If you'd like to send a larger patch for pvdisplay then we could apply that instead.
Thanks, Dave