From: Konstantin Kharlamov <
k.kha...@npobaum.ru>
The difference between the two is that ptype->name has help text. As
result, the help->name and help->help has the same text, which is
unhelpful. It results in help text that looked like the following:
Group name Group name
Fix this by using the this->name instead, which is the actual name. This
makes the example above to look like this instead:
name Group name
Signed-off-by: Konstantin Kharlamov <
k.kha...@npobaum.ru>
---
clish/param/param.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/clish/param/param.c b/clish/param/param.c
index ddaa51a..8f1a945 100644
--- a/clish/param/param.c
+++ b/clish/param/param.c
@@ -106,11 +106,9 @@ void clish_param_help(const clish_param_t * this, clish_help_t *help)
return;
}
- if (CLISH_PARAM_SUBCOMMAND == clish_param__get_mode(this))
- name = clish_param__get_value(this);
- else
- if (!(name = clish_ptype__get_text(this->ptype)))
- name = clish_ptype__get_name(this->ptype);
+ name = (CLISH_PARAM_SUBCOMMAND == clish_param__get_mode(this))
+ ? clish_param__get_value(this)
+ : clish_param__get_name(this);
lub_string_cat(&str, this->text);
if (range) {
--
2.30.0